Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,8 @@ def load_model():
|
|
42 |
print("Model loaded successfully.")
|
43 |
return model, model_config
|
44 |
|
45 |
-
|
|
|
46 |
|
47 |
# Function to set up, generate, and process the audio
|
48 |
@spaces.GPU(duration=60) # Allocate GPU only when this function is called
|
@@ -63,7 +64,6 @@ def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
|
|
63 |
|
64 |
print(f"Sample rate: {sample_rate}, Sample size: {sample_size}")
|
65 |
|
66 |
-
model = model.to(device,torch.bfloat16)
|
67 |
print("Model moved to device.")
|
68 |
|
69 |
# Set up text and timing conditioning
|
|
|
42 |
print("Model loaded successfully.")
|
43 |
return model, model_config
|
44 |
|
45 |
+
model, model_config = load_model()
|
46 |
+
model = model.to(device,torch.bfloat16)
|
47 |
|
48 |
# Function to set up, generate, and process the audio
|
49 |
@spaces.GPU(duration=60) # Allocate GPU only when this function is called
|
|
|
64 |
|
65 |
print(f"Sample rate: {sample_rate}, Sample size: {sample_size}")
|
66 |
|
|
|
67 |
print("Model moved to device.")
|
68 |
|
69 |
# Set up text and timing conditioning
|