Fix indentation error and prioritize 5stems model
Browse files- Fix IndentationError: expected an indented block after 'if' statement
- Change priority back to 5stems model first (as requested)
- Keep 2stems as fallback if 5stems download fails
- This should resolve the runtime error and use preferred 5stems model
app.py
CHANGED
|
@@ -37,19 +37,19 @@ try:
|
|
| 37 |
import os
|
| 38 |
os.environ['SPLEETER_MODEL_PATH'] = '/tmp/spleeter_models'
|
| 39 |
|
| 40 |
-
# Try to load the
|
| 41 |
# Use a more robust approach to handle the redirect issue
|
| 42 |
try:
|
| 43 |
-
spleeter_separator = Separator('spleeter:
|
| 44 |
-
print("Spleeter: Using
|
| 45 |
except Exception as download_error:
|
| 46 |
-
print(f"
|
| 47 |
-
# Try alternative approach - use
|
| 48 |
try:
|
| 49 |
-
spleeter_separator = Separator('spleeter:
|
| 50 |
-
print("Spleeter: Using
|
| 51 |
except Exception as download_error2:
|
| 52 |
-
print(f"
|
| 53 |
# Try with different configuration
|
| 54 |
spleeter_separator = Separator('spleeter:2stems-16kHz', multiprocess=False)
|
| 55 |
print("Spleeter: Using 2stems-16kHz model")
|
|
@@ -378,4 +378,4 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 378 |
""")
|
| 379 |
|
| 380 |
if __name__ == "__main__":
|
| 381 |
-
demo.launch(share=True)
|
|
|
|
| 37 |
import os
|
| 38 |
os.environ['SPLEETER_MODEL_PATH'] = '/tmp/spleeter_models'
|
| 39 |
|
| 40 |
+
# Try to load the 5stems model first (as requested)
|
| 41 |
# Use a more robust approach to handle the redirect issue
|
| 42 |
try:
|
| 43 |
+
spleeter_separator = Separator('spleeter:5stems', multiprocess=False)
|
| 44 |
+
print("Spleeter: Using 5stems model (vocals, drums, bass, other, piano)")
|
| 45 |
except Exception as download_error:
|
| 46 |
+
print(f"5stems download failed: {download_error}")
|
| 47 |
+
# Try alternative approach - use 2stems as fallback
|
| 48 |
try:
|
| 49 |
+
spleeter_separator = Separator('spleeter:2stems', multiprocess=False)
|
| 50 |
+
print("Spleeter: Using 2stems model (vocals + accompaniment)")
|
| 51 |
except Exception as download_error2:
|
| 52 |
+
print(f"2stems download also failed: {download_error2}")
|
| 53 |
# Try with different configuration
|
| 54 |
spleeter_separator = Separator('spleeter:2stems-16kHz', multiprocess=False)
|
| 55 |
print("Spleeter: Using 2stems-16kHz model")
|
|
|
|
| 378 |
""")
|
| 379 |
|
| 380 |
if __name__ == "__main__":
|
| 381 |
+
demo.launch(share=True)
|