Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: mit
|
| 3 |
language:
|
| 4 |
- en
|
|
@@ -7,117 +15,84 @@ tags:
|
|
| 7 |
- ai
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
!
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
-
PYTHON/JS/BASH/CURL
|
| 27 |
-
|
| 28 |
-
no MCP AGENTIC YET CLIENT APP UTILIZSES AGENTIC MCP
|
| 29 |
-
|
| 30 |
-

|
| 31 |
|
| 32 |
https://huggingface.co/facebook/musicgen-large
|
| 33 |
|
| 34 |
-
Massive SM80 build optimized
|
| 35 |
-
|
| 36 |
-
🚫 No MCP AGENTIC RAG AI API for this one—built for 3000 series GPUs with 12GB+ VRAM only. Don’t try 40xx/50xx, it’s a no-go! 😿
|
| 37 |
-
🎵 New SM80 build crafted for large music gen—grab it from the repo! 🔗
|
| 38 |
-
🐍 Python 3.10 is the vibe, 3.9 works but might be buggy 🐛
|
| 39 |
-
🔥 Get the update here: huggingface.co/ghostai1/GHOSTSONAFB
|
| 40 |
-
|
| 41 |
-
⏭️ Next update: Higher link threading, supports up to 8 GTS, no Gen 4 yet. 50xx support? Maybe later!
|
| 42 |
-
|
| 43 |
-
UPDATE FOUND HERE * https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/STABLE12gb3060.py
|
| 44 |
-
|
| 45 |
-
*API EXAMPLE CURL
|
| 46 |
-
```curl -X POST https://533d9ec43354159938.gradio.live/call/set_red_hot_chili_peppers_prompt -s -H "Content-Type: application/json" -d '{
|
| 47 |
-
"data": [
|
| 48 |
-
60,
|
| 49 |
-
"none",
|
| 50 |
-
"none",
|
| 51 |
-
"none",
|
| 52 |
-
"none",
|
| 53 |
-
"none"
|
| 54 |
-
]}' \
|
| 55 |
-
| awk -F'"' '{ print $4}' \
|
| 56 |
-
| read EVENT_ID; curl -N https://533d9ec43354159938.gradio.live/call/set_red_hot_chili_peppers_prompt/$EVENT_ID
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
-
"data": [
|
| 64 |
-
"Hello!!",
|
| 65 |
-
1,
|
| 66 |
-
10,
|
| 67 |
-
0,
|
| 68 |
-
0.1,
|
| 69 |
-
"30",
|
| 70 |
-
60,
|
| 71 |
-
"none",
|
| 72 |
-
"none",
|
| 73 |
-
"none",
|
| 74 |
-
"none",
|
| 75 |
-
"none",
|
| 76 |
-
-30,
|
| 77 |
-
"default",
|
| 78 |
-
"1000",
|
| 79 |
-
"Hello!!"
|
| 80 |
-
]}' \
|
| 81 |
-
| awk -F'"' '{ print $4}' \
|
| 82 |
-
| read EVENT_ID; curl -N https://533d9ec43354159938.gradio.live/call/generate_music_wrapper/$EVENT_ID
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/eDd-f8QJiY4GeMJ8PG_22.mpga"></audio>
|
| 87 |
-
|
| 88 |
-
https://huggingface.co/facebook/musicgen-medium
|
| 89 |
|
|
|
|
| 90 |
|
|
|
|
| 91 |
|
| 92 |
<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/xdLE5yosDG_MtnzkyG4_L.mpga"></audio>
|
| 93 |
|
| 94 |
-
|
|
|
|
|
|
|
| 95 |
|
|
|
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
# use huggingface-cli to sync
|
| 100 |
# 🎵 GhostAI Music Generator 🎸 & VOCAL UPDATE* barks.py 1.5B Optimized to run on 8GB Will release a Large model 12-24 GB soon UPDATE* Stable float16/32 working on INT8
|
| 101 |
|
| 102 |
-
https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/start_bash.sh
|
| 103 |
# SH auto downloader dir etc get FB music perms from HF first
|
| 104 |
|
| 105 |
-
FLOAT16/32 CUDA 11.8 & 12.1
|
| 106 |
|
| 107 |
Welcome to the GhostAI Music Generator! This web-based tool utilizes Meta AI's `musicgen-medium` model to craft high-quality instrumental tracks across genres such as Rock, Techno, Jazz, Classical, and Hip-Hop. The application structures compositions with sections like intros, verses, and choruses, all accessible through an intuitive Gradio interface. Outputs are high-quality MP3 files at 320 kbps, complete with embedded metadata. To enhance audio quality, we've integrated processing features including equalization (EQ), a chorus effect, and peak limiting for a polished sound.
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
|
| 122 |
## Project Evolution and Optimization
|
| 123 |
|
|
@@ -130,178 +105,53 @@ Audio enhancements include:
|
|
| 130 |
- **Gain Adjustment**: +2 dB boost before crossfading to address amplitude dips.
|
| 131 |
- **Compression**: Removed to preserve dynamic range.
|
| 132 |
|
|
|
|
| 133 |
|
| 134 |
-
|
| 135 |
-

|
| 136 |
-
|
| 137 |
-
## System Requirements
|
| 138 |
-
|
| 139 |
-
To get started, ensure your system meets the following requirements:
|
| 140 |
- **Operating System**: Ubuntu (Note: Windows/macOS are untested).
|
| 141 |
- **GPU**: CUDA-capable GPU with at least 8 GB VRAM.
|
| 142 |
- **Python**: Version 3.10.
|
| 143 |
- **ffmpeg**: Installed for audio processing.
|
| 144 |
|
| 145 |
-
## Installation and Setup
|
| 146 |
|
| 147 |
1. **Clone the Repository**:
|
| 148 |
```bash
|
| 149 |
-
git clone https://huggingface.co/
|
| 150 |
cd ghostai-music-generator
|
| 151 |
-
```
|
| 152 |
|
| 153 |
-
|
| 154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
python3 -m venv venv
|
| 156 |
source venv/bin/activate
|
| 157 |
-
```
|
| 158 |
|
| 159 |
-
3.
|
| 160 |
-
For CUDA 12.1:
|
| 161 |
-
```bash
|
| 162 |
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
|
| 163 |
-
|
| 164 |
-
For other CUDA versions, refer to the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
|
| 165 |
|
| 166 |
-
4.
|
| 167 |
-
```bash
|
| 168 |
pip install -r requirements.txt
|
| 169 |
-
```
|
| 170 |
|
| 171 |
-
5.
|
| 172 |
-
```bash
|
| 173 |
sudo apt-get install ffmpeg
|
| 174 |
-
```
|
| 175 |
|
| 176 |
-
6.
|
| 177 |
-
```bash
|
| 178 |
huggingface-cli login
|
| 179 |
-
|
| 180 |
-
Retrieve your token from [Hugging Face Tokens](https://huggingface.co/settings/tokens).
|
| 181 |
|
| 182 |
-
7.
|
| 183 |
-
Visit
|
| 184 |
|
| 185 |
-
8.
|
| 186 |
-
```bash
|
| 187 |
mkdir -p /home/ubuntu/ghostai_music_generator/models/musicgen-medium
|
| 188 |
-
|
| 189 |
-
Place the model weights in the directory above. If you store the model elsewhere, update the `local_model_path` in `app.py` accordingly.
|
| 190 |
-
|
| 191 |
-
## Running the Application
|
| 192 |
-
|
| 193 |
-
Start the application by executing:
|
| 194 |
-
```bash
|
| 195 |
-
python app.py
|
| 196 |
-
```
|
| 197 |
-
This will launch a Gradio UI at `http://0.0.0.0:9999`. Open this URL in your browser to access the interface.
|
| 198 |
-
|
| 199 |
-
## Using the Interface
|
| 200 |
-
|
| 201 |
-
Within the Gradio interface:
|
| 202 |
-
|
| 203 |
-
- **Select a Genre**: Choose from Rock, Techno, Jazz, Classical, or Hip-Hop.
|
| 204 |
-
- **Custom Prompt**: Enter a custom prompt, such as:
|
| 205 |
-
```
|
| 206 |
-
Hard rock with a dynamic intro, expressive verse, and powerful chorus, featuring electric guitars, steady heavy drums, and deep bass.
|
| 207 |
-
```
|
| 208 |
-
- **Adjust Parameters**:
|
| 209 |
-
- **Guidance Scale (CFG)**: Default is 3.0.
|
| 210 |
-
- **Top-K Sampling**: Default is 300.
|
| 211 |
-
- **Top-P Sampling**: Default is 0.95.
|
| 212 |
-
- **Temperature**: Default is 1.0.
|
| 213 |
-
- **Total Duration**: Set to 30 seconds (range: 10-60).
|
| 214 |
-
- **Crossfade Duration**: Set to 500 ms (range: 100-2000).
|
| 215 |
-
- **Generate Music**: Click "Generate Music" to create the track. The output will be saved as `output_cleaned.mp3` and played within Gradio.
|
| 216 |
-
|
| 217 |
-
Monitor the terminal output for VRAM and GPU memory usage to ensure smooth operation.
|
| 218 |
-
|
| 219 |
-
## Troubleshooting and Customization
|
| 220 |
-
|
| 221 |
-
- **Quiet Spots in Waveform**: Edit `app.py` to increase gain before crossfading:
|
| 222 |
-
```python
|
| 223 |
-
next_segment = next_segment + 3
|
| 224 |
-
```
|
| 225 |
-
Use tools like Audacity to inspect and adjust the waveform.
|
| 226 |
-
|
| 227 |
-
- **Enhancing the Chorus**: Modify the second chunk prompt to:
|
| 228 |
-
```
|
| 229 |
-
explosive chorus with soaring guitars and pounding drums
|
| 230 |
-
```
|
| 231 |
-
Or increase the temperature to 1.2 and `top_k` to 350 in the UI.
|
| 232 |
-
|
| 233 |
-
- **Audio Distortion**: Reduce the chorus effect gain in `apply_chorus`:
|
| 234 |
-
```python
|
| 235 |
-
delayed = segment - 6
|
| 236 |
-
```
|
| 237 |
-
Adjust EQ settings in `apply_eq` with a high-pass at 80 Hz and low-pass at 5000 Hz.
|
| 238 |
-
|
| 239 |
-
- **MP3 Export Issues**: Ensure `ffmpeg` is installed:
|
| 240 |
-
```bash
|
| 241 |
-
sudo apt-get install ffmpeg
|
| 242 |
-
```
|
| 243 |
-
Check the existence of `chunk_{i}.mp3` and `output_cleaned.mp3` files.
|
| 244 |
-
|
| 245 |
-
- **VRAM Constraints**: Reduce the total duration to 20 seconds, close other GPU-intensive applications using `nvidia-smi`, and monitor usage with:
|
| 246 |
-
```python
|
| 247 |
-
print(torch.cuda.memory_summary())
|
| 248 |
-
```
|
| 249 |
-
|
| 250 |
-
## Customization Options
|
| 251 |
-
|
| 252 |
-
- **Lock Dependencies**:
|
| 253 |
-
```bash
|
| 254 |
-
pip freeze > requirements.txt
|
| 255 |
-
```
|
| 256 |
-
|
| 257 |
-
- **Add New Genres**: In `app.py`, define a new genre prompt:
|
| 258 |
-
```python
|
| 259 |
-
def set_pop_prompt():
|
| 260 |
-
return "Pop with a catchy intro, upbeat verse, and anthemic chorus, featuring bright synths, punchy drums, and groovy bass"
|
| 261 |
-
```
|
| 262 |
-
Add a button for the new genre:
|
| 263 |
-
```python
|
| 264 |
-
pop_btn = gr.Button("Pop", elem_classes="genre-btn")
|
| 265 |
-
pop_btn.click(set_pop_prompt, inputs=None, outputs=[instrumental_prompt])
|
| 266 |
-
```
|
| 267 |
-
|
| 268 |
-
- **Edit MP3 Files**: Use Audacity or similar tools for more control over the final output.
|
| 269 |
-
|
| 270 |
-
- **Use a Smaller Model**: If VRAM is limited, switch to `musicgen-small` by updating `app.py`:
|
| 271 |
-
```python
|
| 272 |
-
musicgen_model = MusicGen.get_pretrained('facebook/musicgen-small', device=device)
|
| 273 |
-
```
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
### Prerequisites
|
| 277 |
-
- Ubuntu system with Python 3.10 installed.
|
| 278 |
-
- NVIDIA RTX 3060 Ti GPU with CUDA support (CUDA 11.8 recommended).
|
| 279 |
-
- Internet connection to download the `musicgen-medium` model.
|
| 280 |
-
|
| 281 |
-
### Step 1: Make the Setup Script Executable
|
| 282 |
-
The `start_bash.sh` script sets up the virtual environment, installs dependencies, and downloads the `musicgen-medium` model. First, make the script executable:
|
| 283 |
-
|
| 284 |
-
```bash
|
| 285 |
-
chmod +x start_bash.sh
|
| 286 |
-
|
| 287 |
-
## License and Acknowledgments
|
| 288 |
-
|
| 289 |
-
This project is licensed under the MIT License. Please include a LICENSE file with the MIT License text.
|
| 290 |
-
|
| 291 |
-
Special thanks to:
|
| 292 |
-
- Meta AI for `musicgen-medium` and Audiocraft.
|
| 293 |
-
- Hugging Face for hosting and CLI tools.
|
| 294 |
-
- Gradio for the web interface.
|
| 295 |
-
- pydub for audio processing and MP3 export.
|
| 296 |
-
- xAI for their support.
|
| 297 |
-
|
| 298 |
-
Enjoy creating music! If you have questions or suggestions, feel free to open an issue on the repository. Let's make some tunes! 🎉
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
CUDA 12 MEMORY MANAGEMENT UPDATE
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-

|
| 306 |
|
|
|
|
|
|
|
|
|
|
| 307 |
|
|
|
|
| 1 |
---
|
| 2 |
+
title: GhostAI Music Generator
|
| 3 |
+
emoji: 🎵
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
license: mit
|
| 11 |
language:
|
| 12 |
- en
|
|
|
|
| 15 |
- ai
|
| 16 |
---
|
| 17 |
|
| 18 |
+
<div align="center">
|
| 19 |
|
| 20 |
+
# 🎵 GhostAI Music Generator 🎸
|
| 21 |
|
| 22 |
+
[](https://www.python.org/downloads/)
|
| 23 |
+
[](LICENSE)
|
| 24 |
+
[](https://huggingface.co/ghostai1/GHOSTSONAFB)
|
| 25 |
+
[](https://developer.nvidia.com/cuda-downloads)
|
| 26 |
|
| 27 |
+
**FULL API build [beta build] Optimized to handle full 30/60/180 second renders**
|
| 28 |
|
| 29 |
+
Generate high-quality instrumental tracks with Meta AI's MusicGen models!
|
| 30 |
|
| 31 |
+
</div>
|
| 32 |
|
| 33 |
+
<div align="center">
|
| 34 |
+
<table>
|
| 35 |
+
<tr>
|
| 36 |
+
<td align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/-P3uQK1P_qP9F1GjzhgCm.png" width="200" height="200" alt="Interface 1" /></td>
|
| 37 |
+
<td align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/8oGZ0g0ZmKuYDp2tbwkf4.png" width="200" height="200" alt="Interface 2" /></td>
|
| 38 |
+
</tr>
|
| 39 |
+
<tr>
|
| 40 |
+
<td align="center"><audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/RifW0nT3T-Y5Q3kawuHu2.mpga"></audio></td>
|
| 41 |
+
<td align="center"><audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/eDd-f8QJiY4GeMJ8PG_22.mpga"></audio></td>
|
| 42 |
+
</tr>
|
| 43 |
+
</table>
|
| 44 |
+
</div>
|
| 45 |
|
| 46 |
+
🚀 **Updated Repo Alert! MUSIC GEN LARGE FULL API [BETA]🚀**
|
| 47 |
|
| 48 |
+
PYTHON/JS/BASH/CURL • No MCP AGENTIC YET, CLIENT APP UTILIZES AGENTIC MCP
|
| 49 |
|
| 50 |
+

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
https://huggingface.co/facebook/musicgen-large
|
| 53 |
|
| 54 |
+
**Massive SM80 build optimized for CUDA 12.1 & cuDNN 9!** 🛠️ 🎉 No dependencies, raw file update dropped in repo! 📂
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
🚫 **No MCP AGENTIC RAG AI API**—built for 3000 series GPUs with 12GB+ VRAM only. Don’t try 40xx/50xx, it’s a no-go! 😿
|
| 57 |
+
🎵 **New SM80 build crafted for large music gen**—grab it from the repo! 🔗
|
| 58 |
+
🐍 **Python 3.10 is the vibe**, 3.9 works but might be buggy 🐛
|
| 59 |
+
🔥 **Get the update here**: https://huggingface.co/ghostai1/GHOSTSONAFB
|
| 60 |
|
| 61 |
+
⏭️ **Next update**: Higher link threading, supports up to 8 GTS, no Gen 4 yet. 50xx support? Maybe later!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
+
**UPDATE FOUND HERE**: https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/STABLE12gb3060.py
|
| 64 |
|
| 65 |
+
**Scripts**: https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/stable12gblg30sec.py
|
| 66 |
|
| 67 |
<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/xdLE5yosDG_MtnzkyG4_L.mpga"></audio>
|
| 68 |
|
| 69 |
+
https://huggingface.co/facebook/musicgen-medium
|
| 70 |
+
|
| 71 |
+

|
| 72 |
|
| 73 |
+

|
| 74 |
|
| 75 |
+
# Use huggingface-cli to sync
|
| 76 |
|
|
|
|
| 77 |
# 🎵 GhostAI Music Generator 🎸 & VOCAL UPDATE* barks.py 1.5B Optimized to run on 8GB Will release a Large model 12-24 GB soon UPDATE* Stable float16/32 working on INT8
|
| 78 |
|
| 79 |
+
https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/start_bash.sh
|
| 80 |
# SH auto downloader dir etc get FB music perms from HF first
|
| 81 |
|
| 82 |
+
**FLOAT16/32 CUDA 11.8 & 12.1** 4bit for lower end 8 bit full
|
| 83 |
|
| 84 |
Welcome to the GhostAI Music Generator! This web-based tool utilizes Meta AI's `musicgen-medium` model to craft high-quality instrumental tracks across genres such as Rock, Techno, Jazz, Classical, and Hip-Hop. The application structures compositions with sections like intros, verses, and choruses, all accessible through an intuitive Gradio interface. Outputs are high-quality MP3 files at 320 kbps, complete with embedded metadata. To enhance audio quality, we've integrated processing features including equalization (EQ), a chorus effect, and peak limiting for a polished sound.
|
| 85 |
|
| 86 |
+
<div align="center">
|
| 87 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/5PCpX_7Yuhs8S9BEDck_5.png" width="45%" alt="UI Preview">
|
| 88 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/R-UxaeGKbM_tK6B7lCGIE.png" width="45%" alt="Output">
|
| 89 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/LZkcrdpN5PQXOF4pj33bu.png" width="45%" alt="Controls">
|
| 90 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/sIIjdL3it8MSw9w5XBz0q.png" width="45%" alt="Processing">
|
| 91 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/HcBK7X9373CVYO5zyo4YL.png" width="45%" alt="Results">
|
| 92 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/MoQb9arla6rXGepgFugNp.png" width="45%" alt="Analytics">
|
| 93 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/b78antJwwWAx-jFfXoYHk.png" width="45%" alt="Performance">
|
| 94 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/fzyGz3Ondrr_snqH8yHiG.png" width="45%" alt="CUDA Update">
|
| 95 |
+
</div>
|
|
|
|
|
|
|
| 96 |
|
| 97 |
## Project Evolution and Optimization
|
| 98 |
|
|
|
|
| 105 |
- **Gain Adjustment**: +2 dB boost before crossfading to address amplitude dips.
|
| 106 |
- **Compression**: Removed to preserve dynamic range.
|
| 107 |
|
| 108 |
+
## 🖥️ System Requirements
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
- **Operating System**: Ubuntu (Note: Windows/macOS are untested).
|
| 111 |
- **GPU**: CUDA-capable GPU with at least 8 GB VRAM.
|
| 112 |
- **Python**: Version 3.10.
|
| 113 |
- **ffmpeg**: Installed for audio processing.
|
| 114 |
|
| 115 |
+
## ⚙️ Installation and Setup
|
| 116 |
|
| 117 |
1. **Clone the Repository**:
|
| 118 |
```bash
|
| 119 |
+
git clone https://huggingface.co/ghostai1/ghostai-music-generator
|
| 120 |
cd ghostai-music-generator
|
|
|
|
| 121 |
|
| 122 |
+
|
| 123 |
+
## ⚙️ Installation and Setup
|
| 124 |
+
|
| 125 |
+
1. Clone the Repository:
|
| 126 |
+
git clone https://huggingface.co/ghostai1/ghostai-music-generator
|
| 127 |
+
cd ghostai-music-generator
|
| 128 |
+
|
| 129 |
+
2. Set Up a Virtual Environment:
|
| 130 |
python3 -m venv venv
|
| 131 |
source venv/bin/activate
|
|
|
|
| 132 |
|
| 133 |
+
3. Install PyTorch (CUDA 12.1):
|
|
|
|
|
|
|
| 134 |
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
|
| 135 |
+
For other CUDA versions, refer to https://pytorch.org/get-started/locally/.
|
|
|
|
| 136 |
|
| 137 |
+
4. Install Other Dependencies:
|
|
|
|
| 138 |
pip install -r requirements.txt
|
|
|
|
| 139 |
|
| 140 |
+
5. Install ffmpeg:
|
|
|
|
| 141 |
sudo apt-get install ffmpeg
|
|
|
|
| 142 |
|
| 143 |
+
6. Authenticate with Hugging Face:
|
|
|
|
| 144 |
huggingface-cli login
|
| 145 |
+
Retrieve token from https://huggingface.co/settings/tokens
|
|
|
|
| 146 |
|
| 147 |
+
7. Request Access to the Model:
|
| 148 |
+
Visit https://huggingface.co/facebook/musicgen-medium and request access.
|
| 149 |
|
| 150 |
+
8. Download and Place Model Weights:
|
|
|
|
| 151 |
mkdir -p /home/ubuntu/ghostai_music_generator/models/musicgen-medium
|
| 152 |
+
Place the model weights in the directory above. Update local_model_path in app.py if stored elsewhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
+
9. Run Setup Script:
|
| 155 |
+
chmod +x start_bash.sh
|
| 156 |
+
./start_bash.sh
|
| 157 |
|