Spaces:
Running
on
Zero
Running
on
Zero
Gamahea
commited on
Commit
·
bba8617
1
Parent(s):
ffa4f60
Deploy Music Generation Studio - 2025-12-12 16:11
Browse files- backend/app.py +6 -6
- backend/routes/export.py +2 -2
- backend/routes/generation.py +7 -7
- backend/routes/mastering.py +1 -1
- backend/routes/timeline.py +2 -2
- backend/services/export_service.py +1 -1
- backend/services/fish_speech_service.py +1 -1
- backend/services/lyricmind_service.py +2 -2
- backend/services/timeline_service.py +1 -1
backend/app.py
CHANGED
|
@@ -7,12 +7,12 @@ from flask import Flask, jsonify, send_from_directory
|
|
| 7 |
from flask_cors import CORS
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
|
| 10 |
-
from
|
| 11 |
-
from
|
| 12 |
-
from
|
| 13 |
-
from
|
| 14 |
-
from
|
| 15 |
-
from
|
| 16 |
|
| 17 |
# Load environment variables
|
| 18 |
load_dotenv()
|
|
|
|
| 7 |
from flask_cors import CORS
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
|
| 10 |
+
from config.settings import Config
|
| 11 |
+
from routes.generation import generation_bp
|
| 12 |
+
from routes.timeline import timeline_bp
|
| 13 |
+
from routes.export import export_bp
|
| 14 |
+
from routes.mastering import mastering_bp
|
| 15 |
+
from utils.logger import setup_logger
|
| 16 |
|
| 17 |
# Load environment variables
|
| 18 |
load_dotenv()
|
backend/routes/export.py
CHANGED
|
@@ -4,8 +4,8 @@ Routes for exporting/downloading music
|
|
| 4 |
import logging
|
| 5 |
import os
|
| 6 |
from flask import Blueprint, request, jsonify, send_file, current_app
|
| 7 |
-
from
|
| 8 |
-
from
|
| 9 |
|
| 10 |
logger = logging.getLogger(__name__)
|
| 11 |
|
|
|
|
| 4 |
import logging
|
| 5 |
import os
|
| 6 |
from flask import Blueprint, request, jsonify, send_file, current_app
|
| 7 |
+
from services.export_service import ExportService
|
| 8 |
+
from models.schemas import ExportFormat
|
| 9 |
|
| 10 |
logger = logging.getLogger(__name__)
|
| 11 |
|
backend/routes/generation.py
CHANGED
|
@@ -4,13 +4,13 @@ Routes for music generation
|
|
| 4 |
import os
|
| 5 |
import logging
|
| 6 |
from flask import Blueprint, request, jsonify, current_app
|
| 7 |
-
from
|
| 8 |
-
from
|
| 9 |
-
from
|
| 10 |
-
from
|
| 11 |
-
from
|
| 12 |
-
from
|
| 13 |
-
from
|
| 14 |
|
| 15 |
logger = logging.getLogger(__name__)
|
| 16 |
|
|
|
|
| 4 |
import os
|
| 5 |
import logging
|
| 6 |
from flask import Blueprint, request, jsonify, current_app
|
| 7 |
+
from services.diffrhythm_service import DiffRhythmService
|
| 8 |
+
from services.lyricmind_service import LyricMindService
|
| 9 |
+
from services.style_consistency_service import StyleConsistencyService
|
| 10 |
+
from services.timeline_service import TimelineService
|
| 11 |
+
from models.schemas import GenerationRequest, LyricsRequest
|
| 12 |
+
from utils.validators import validate_generation_params
|
| 13 |
+
from utils.prompt_analyzer import PromptAnalyzer
|
| 14 |
|
| 15 |
logger = logging.getLogger(__name__)
|
| 16 |
|
backend/routes/mastering.py
CHANGED
|
@@ -4,7 +4,7 @@ Routes for audio mastering and EQ
|
|
| 4 |
import os
|
| 5 |
import logging
|
| 6 |
from flask import Blueprint, request, jsonify, current_app, send_file
|
| 7 |
-
from
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
logger = logging.getLogger(__name__)
|
|
|
|
| 4 |
import os
|
| 5 |
import logging
|
| 6 |
from flask import Blueprint, request, jsonify, current_app, send_file
|
| 7 |
+
from services.mastering_service import MasteringService
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
logger = logging.getLogger(__name__)
|
backend/routes/timeline.py
CHANGED
|
@@ -3,8 +3,8 @@ Routes for timeline management
|
|
| 3 |
"""
|
| 4 |
import logging
|
| 5 |
from flask import Blueprint, request, jsonify
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
|
|
|
| 3 |
"""
|
| 4 |
import logging
|
| 5 |
from flask import Blueprint, request, jsonify
|
| 6 |
+
from services.timeline_service import TimelineService
|
| 7 |
+
from models.schemas import ClipPosition
|
| 8 |
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
backend/services/export_service.py
CHANGED
|
@@ -6,7 +6,7 @@ import logging
|
|
| 6 |
from typing import Optional, List
|
| 7 |
import numpy as np
|
| 8 |
import soundfile as sf
|
| 9 |
-
from
|
| 10 |
|
| 11 |
logger = logging.getLogger(__name__)
|
| 12 |
|
|
|
|
| 6 |
from typing import Optional, List
|
| 7 |
import numpy as np
|
| 8 |
import soundfile as sf
|
| 9 |
+
from services.timeline_service import TimelineService
|
| 10 |
|
| 11 |
logger = logging.getLogger(__name__)
|
| 12 |
|
backend/services/fish_speech_service.py
CHANGED
|
@@ -32,7 +32,7 @@ class FishSpeechService:
|
|
| 32 |
def _get_device(self):
|
| 33 |
"""Get compute device (AMD GPU via DirectML or CPU)"""
|
| 34 |
try:
|
| 35 |
-
from
|
| 36 |
return DEFAULT_DEVICE
|
| 37 |
except:
|
| 38 |
return torch.device("cpu")
|
|
|
|
| 32 |
def _get_device(self):
|
| 33 |
"""Get compute device (AMD GPU via DirectML or CPU)"""
|
| 34 |
try:
|
| 35 |
+
from utils.amd_gpu import DEFAULT_DEVICE
|
| 36 |
return DEFAULT_DEVICE
|
| 37 |
except:
|
| 38 |
return torch.device("cpu")
|
backend/services/lyricmind_service.py
CHANGED
|
@@ -29,7 +29,7 @@ class LyricMindService:
|
|
| 29 |
def _get_device(self):
|
| 30 |
"""Get compute device (AMD GPU via DirectML or CPU)"""
|
| 31 |
try:
|
| 32 |
-
from
|
| 33 |
return DEFAULT_DEVICE
|
| 34 |
except:
|
| 35 |
return torch.device("cpu")
|
|
@@ -94,7 +94,7 @@ class LyricMindService:
|
|
| 94 |
self._initialize_model()
|
| 95 |
|
| 96 |
# Use prompt analysis for better context
|
| 97 |
-
from
|
| 98 |
|
| 99 |
if prompt_analysis is None:
|
| 100 |
analysis = PromptAnalyzer.analyze(prompt)
|
|
|
|
| 29 |
def _get_device(self):
|
| 30 |
"""Get compute device (AMD GPU via DirectML or CPU)"""
|
| 31 |
try:
|
| 32 |
+
from utils.amd_gpu import DEFAULT_DEVICE
|
| 33 |
return DEFAULT_DEVICE
|
| 34 |
except:
|
| 35 |
return torch.device("cpu")
|
|
|
|
| 94 |
self._initialize_model()
|
| 95 |
|
| 96 |
# Use prompt analysis for better context
|
| 97 |
+
from utils.prompt_analyzer import PromptAnalyzer
|
| 98 |
|
| 99 |
if prompt_analysis is None:
|
| 100 |
analysis = PromptAnalyzer.analyze(prompt)
|
backend/services/timeline_service.py
CHANGED
|
@@ -3,7 +3,7 @@ Timeline management service
|
|
| 3 |
"""
|
| 4 |
import logging
|
| 5 |
from typing import List, Dict, Optional
|
| 6 |
-
from
|
| 7 |
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
|
|
|
| 3 |
"""
|
| 4 |
import logging
|
| 5 |
from typing import List, Dict, Optional
|
| 6 |
+
from models.schemas import ClipPosition, TimelineClip
|
| 7 |
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|