Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,9 @@ def load_model():
|
|
| 17 |
print("Model loaded successfully.")
|
| 18 |
return model, model_config
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
# Function to set up, generate, and process the audio
|
| 21 |
@spaces.GPU(duration=120) # Allocate GPU only when this function is called
|
| 22 |
def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
|
|
@@ -95,9 +98,5 @@ interface = gr.Interface(
|
|
| 95 |
title="Synthio Stable Audio Generator",
|
| 96 |
description="Generate variable-length stereo audio at 44.1kHz from text prompts using Synthio's Stable Audio Open 1.0.")
|
| 97 |
|
| 98 |
-
|
| 99 |
-
# Pre-load the model to avoid multiprocessing issues
|
| 100 |
-
model, model_config = load_model()
|
| 101 |
-
|
| 102 |
# Launch the Interface
|
| 103 |
interface.launch()
|
|
|
|
| 17 |
print("Model loaded successfully.")
|
| 18 |
return model, model_config
|
| 19 |
|
| 20 |
+
# Pre-load the model to avoid multiprocessing issues
|
| 21 |
+
model, model_config = load_model()
|
| 22 |
+
|
| 23 |
# Function to set up, generate, and process the audio
|
| 24 |
@spaces.GPU(duration=120) # Allocate GPU only when this function is called
|
| 25 |
def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
|
|
|
|
| 98 |
title="Synthio Stable Audio Generator",
|
| 99 |
description="Generate variable-length stereo audio at 44.1kHz from text prompts using Synthio's Stable Audio Open 1.0.")
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
# Launch the Interface
|
| 102 |
interface.launch()
|