Spaces:
Build error
Build error
AudioForge Backend
FastAPI backend for open-source music generation.
Setup
- Install dependencies:
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
- Set up environment variables:
cp .env.example .env
# Edit .env with your settings
- Start PostgreSQL and Redis (using Docker):
docker-compose up -d postgres redis
- Run migrations:
alembic upgrade head
- Start the server:
uvicorn app.main:app --reload
Music Generation Models
MusicGen (Required)
MusicGen is used for instrumental music generation. It will be automatically downloaded on first use.
Bark (Optional)
Bark is used for vocal generation. To install:
pip install bark
Or use the Hugging Face transformers version:
pip install transformers[torch] soundfile
Then update app/services/vocal_generation.py to use the transformers-based implementation.
API Documentation
Once running, visit:
- Swagger UI: http://localhost:8000/api/docs
- ReDoc: http://localhost:8000/api/redoc
Testing
pytest tests/ -v
Development
# Format code
make format
# Type check
make type-check
# Lint
make lint