Metadata-Version: 2.4
Name: pymss-core
Version: 0.1.2
Summary: Core model, configuration, and checkpoint package for music source separation.
Author-email: KitsuneX07 <ghast1085654218@163.com>
Maintainer-email: baicai1145 <3423714059@qq.com>
License-Expression: MIT
Project-URL: Bug Tracker, https://github.com/pymss-project/pymss-core/issues
Project-URL: Source Code, https://github.com/pymss-project/pymss-core
Project-URL: Documentation, https://github.com/pymss-project/pymss-core/blob/main/README.md
Keywords: music source separation,audio separation,music processing,machine learning,audio
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: torch>=2.7.1
Provides-Extra: mlx
Requires-Dist: mlx>=0.31.0; (sys_platform == "darwin" and platform_machine == "arm64") and extra == "mlx"
Dynamic: license-file

# pymss-core

[中文文档](README_CN.md)

Core model, configuration, and checkpoint package for music source separation.

`pymss-core` is the shared low-level package for higher-level projects such as
`pymss` inference and `pymsst` training. It contains model definitions,
configuration loading, and checkpoint compatibility helpers. It intentionally
does not include inference DSP pipelines, chunked demixing, audio file I/O,
model downloads, catalog management, CLI, HTTP server, WebUI, datasets, losses,
or training loops.

## Install

```bash
pip install pymss-core
```

For local development:

```bash
uv sync --dev
```

Optional MLX backend on Apple Silicon:

```bash
pip install "pymss-core[mlx]"
```

## Public API

```python
from pymss_core import (
    get_model_from_config,
    load_config,
    load_model_weights,
)

model, config = get_model_from_config("bs_roformer", "config.yaml")
load_model_weights(model, "model.ckpt", model_type="bs_roformer", strict=True)

model.eval()
```

## Package Boundary

Included:

- YAML config loading with `AttrDict`
- PyTorch model definitions under `pymss_core.modules`
- Optional MLX backend implementations for supported model forward paths
- Model factory: `get_model_from_config(model_type, config_path)`
- Checkpoint helpers for common MSS checkpoint containers
- Small model-internal DSP math needed to construct model structures
- VR network structures and VR model parameter JSON files

Excluded:

- Audio file decoding/encoding
- Resampling, preprocessing, and full inference DSP pipelines
- Tensor-level chunked demixing runtime
- Model catalog, aliases, downloads, and cache management
- CLI, server, WebUI, and endpoint schemas
- Dataset, augmentation, loss, metrics, and trainer code
- Any default dependency on MLX, Librosa, tqdm, Lightning, FastAPI, Uvicorn,
  PyAV, WandB, or training extras

## Repository Roles

```text
pymss-core
  shared model/config/checkpoint layer

pymss
  user-facing inference package built on pymss-core, with audio I/O and demix

pymsst
  training package built on pymss-core, with training data/loss/runtime code
```
