|
# Container Template for SoundsRight Subnet Miners |
|
|
|
Miners in [Bittensor's](https://bittensor.com/) [SoundsRight Subnet](https://github.com/synapsec-ai/SoundsRightSubnet) must containerize their models before uploading to HuggingFace. This repo serves as a template. |
|
|
|
The branches `DENOISING_16000HZ` and `DEREVERBERATION_16000HZ` contain this template fitted with [SGMSE+](https://huggingface.co/sp-uhh/speech-enhancement-sgmse) and are also helpful resources for how to incorporate your model. |
|
|
|
The `main` branch contains a template for a container that will spin up an API to communicate with the validator. The following entrypoints cannot be altered: |
|
|
|
1. `/status/` : Communicates API status |
|
2. `/prepare/` : Makes necessary preparations (downloading checkpoints, etc.) and initializes model |
|
3. `/upload-audio/` : Upload audio files, save to noisy audio directory |
|
4. `/enhance/` : Initialize model, enhance audio files, save to enhanced audio directory |
|
5. `/download-enhanced/` : Download enhanced audio files |
|
|
|
To add your own model to this template, there are a few things that a miner must do: |
|
|
|
1. Add the model files under the `model` directory. |
|
2. Modify the `modelapi.prepare` method in `app/app.py` with necessary preparations to initialize your model. |
|
3. Modify the `modelapi.enhance` method in `app/app.py` with the logic your model uses to enhance audio. |
|
4. Update `dependencies` in `pyproject.toml` with the dependencies used by your model. |
|
5. If you have directories other than `app` in your repository, be sure to modify the `Dockerfile` accordingly (reference line 12 in the `Dockerfile` for how to do this). |
|
6. Cite your sources (if applicable). |
|
|
|
For your model to be processed by validators, there are a few formatting requirements. Note that the template already has been formatted to fit these guidelines. |
|
|
|
1. API endpoints must as outlined above. |
|
2. Port must be 6500. |
|
3. Container must be configured to run as non-root user. |