Spaces:
Running
on
Zero
Running
on
Zero
chong.zhang
commited on
Commit
·
1fc806b
1
Parent(s):
c2ba1ca
update
Browse files
app.py
CHANGED
@@ -28,8 +28,8 @@ def download_model(model_name="InspireMusic-Base"):
|
|
28 |
|
29 |
def get_args(
|
30 |
task, text="", audio=None, model_name="InspireMusic-Base",
|
31 |
-
chorus="intro", fast=False, fade_out=True,
|
32 |
-
output_sample_rate=48000, max_generate_audio_seconds=30.0, time_start = 0.0, time_end=30.0):
|
33 |
# This function constructs the arguments required for InspireMusic
|
34 |
args = {
|
35 |
"task" : task,
|
@@ -55,10 +55,10 @@ def get_args(
|
|
55 |
|
56 |
if args["time_start"] is None:
|
57 |
args["time_start"] = 0.0
|
58 |
-
if args["time_end"] is None:
|
59 |
-
|
60 |
-
if args["time_start"] > args["time_end"]:
|
61 |
-
|
62 |
|
63 |
print(args)
|
64 |
return args
|
@@ -163,7 +163,7 @@ with gr.Blocks() as demo:
|
|
163 |
button = gr.Button(value=prompt)
|
164 |
button.click(run_inspiremusic,
|
165 |
inputs = [task, text_input, None, model_name,
|
166 |
-
chorus, fast, fade_out,
|
167 |
output_sample_rate,
|
168 |
max_generate_audio_seconds],
|
169 |
outputs = music_output)
|
|
|
28 |
|
29 |
def get_args(
|
30 |
task, text="", audio=None, model_name="InspireMusic-Base",
|
31 |
+
chorus="intro", fast=False, fade_out=True,
|
32 |
+
output_sample_rate=48000, max_generate_audio_seconds=30.0, time_start = 0.0, time_end=30.0, trim=False):
|
33 |
# This function constructs the arguments required for InspireMusic
|
34 |
args = {
|
35 |
"task" : task,
|
|
|
55 |
|
56 |
if args["time_start"] is None:
|
57 |
args["time_start"] = 0.0
|
58 |
+
# if args["time_end"] is None:
|
59 |
+
# args["time_end"] = args["time_start"] + args["max_generate_audio_seconds"]
|
60 |
+
# if args["time_start"] > args["time_end"]:
|
61 |
+
args["time_end"] = args["time_start"] + args["max_generate_audio_seconds"]
|
62 |
|
63 |
print(args)
|
64 |
return args
|
|
|
163 |
button = gr.Button(value=prompt)
|
164 |
button.click(run_inspiremusic,
|
165 |
inputs = [task, text_input, None, model_name,
|
166 |
+
chorus, fast, fade_out,
|
167 |
output_sample_rate,
|
168 |
max_generate_audio_seconds],
|
169 |
outputs = music_output)
|