Spaces:
Runtime error
Runtime error
Commit
·
6394bbc
1
Parent(s):
03e9f30
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
|
|
|
|
|
|
| 4 |
from model import Jamify
|
| 5 |
|
| 6 |
# Initialize the Jamify model once
|
|
@@ -9,6 +11,9 @@ jamify_model = Jamify()
|
|
| 9 |
print("Jamify model ready.")
|
| 10 |
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
@spaces.GPU(duration=100)
|
| 13 |
def generate_song(reference_audio, lyrics_file, style_prompt, duration):
|
| 14 |
# We need to save the uploaded files to temporary paths to pass to the model
|
|
@@ -20,7 +25,7 @@ def generate_song(reference_audio, lyrics_file, style_prompt, duration):
|
|
| 20 |
|
| 21 |
output_path = jamify_model.predict(
|
| 22 |
reference_audio_path=reference_audio,
|
| 23 |
-
lyrics_json_path=lyrics_file
|
| 24 |
style_prompt=style_prompt,
|
| 25 |
duration_sec=duration
|
| 26 |
)
|
|
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
from model import Jamify
|
| 7 |
|
| 8 |
# Initialize the Jamify model once
|
|
|
|
| 11 |
print("Jamify model ready.")
|
| 12 |
|
| 13 |
|
| 14 |
+
|
| 15 |
+
gr.set_static_paths(paths=[Path.cwd().absolute()])
|
| 16 |
+
|
| 17 |
@spaces.GPU(duration=100)
|
| 18 |
def generate_song(reference_audio, lyrics_file, style_prompt, duration):
|
| 19 |
# We need to save the uploaded files to temporary paths to pass to the model
|
|
|
|
| 25 |
|
| 26 |
output_path = jamify_model.predict(
|
| 27 |
reference_audio_path=reference_audio,
|
| 28 |
+
lyrics_json_path=lyrics_file,
|
| 29 |
style_prompt=style_prompt,
|
| 30 |
duration_sec=duration
|
| 31 |
)
|