Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
|
| 14 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
| 15 |
|
| 16 |
max_results = 100
|
| 17 |
-
max_output =
|
| 18 |
|
| 19 |
|
| 20 |
# Cacher le nom du repo
|
|
@@ -65,14 +65,20 @@ def process(prompt, lang):
|
|
| 65 |
#writer.writerow(dict_catalog[file].values())
|
| 66 |
count += 1
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
audio_names[I[0][0]].split('.')[0], get_url_myma(I[0][0], audio_names, url_dict),
|
| 71 |
audio_names[I[0][1]].split('.')[0], get_url_myma(I[0][1], audio_names, url_dict),
|
| 72 |
audio_names[I[0][2]].split('.')[0], get_url_myma(I[0][2], audio_names, url_dict),
|
| 73 |
audio_names[I[0][3]].split('.')[0], get_url_myma(I[0][3], audio_names, url_dict),
|
| 74 |
audio_names[I[0][4]].split('.')[0], get_url_myma(I[0][4], audio_names, url_dict)]
|
| 75 |
'''
|
|
|
|
| 76 |
except:
|
| 77 |
return ["",
|
| 78 |
"Error input - please try again", "",
|
|
@@ -105,12 +111,18 @@ poc_examples = [
|
|
| 105 |
["90 eurodance beat","en"],
|
| 106 |
]
|
| 107 |
|
| 108 |
-
outputs = [gr.File()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
gr.Textbox(label="Track name 1"), gr.Audio(label="Track 1", show_label=False),
|
| 110 |
gr.Textbox(label="Track name 2"), gr.Audio(label="Track 2", show_label=False),
|
| 111 |
gr.Textbox(label="Track name 3"), gr.Audio(label="Track 3", show_label=False),
|
| 112 |
gr.Textbox(label="Track name 4"), gr.Audio(label="Track 4", show_label=False),
|
| 113 |
gr.Textbox(label="Track name 5"), gr.Audio(label="Track 5", show_label=False)]
|
|
|
|
| 114 |
demo1 = gr.Interface(fn=process, inputs=inputs, outputs=outputs, examples=poc_examples, cache_examples=False, examples_per_page=20)
|
| 115 |
|
| 116 |
demo1.launch(debug=False)
|
|
|
|
| 14 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
| 15 |
|
| 16 |
max_results = 100
|
| 17 |
+
max_output = 5
|
| 18 |
|
| 19 |
|
| 20 |
# Cacher le nom du repo
|
|
|
|
| 65 |
#writer.writerow(dict_catalog[file].values())
|
| 66 |
count += 1
|
| 67 |
|
| 68 |
+
out = [output_csv]
|
| 69 |
+
for i in range(max_output):
|
| 70 |
+
out.append(audio_names[I[0][i]].split('.')[0])
|
| 71 |
+
out.append(get_url_myma(I[0][i], audio_names, url_dict))
|
| 72 |
+
|
| 73 |
+
return out
|
| 74 |
+
'''return [output_csv,
|
| 75 |
audio_names[I[0][0]].split('.')[0], get_url_myma(I[0][0], audio_names, url_dict),
|
| 76 |
audio_names[I[0][1]].split('.')[0], get_url_myma(I[0][1], audio_names, url_dict),
|
| 77 |
audio_names[I[0][2]].split('.')[0], get_url_myma(I[0][2], audio_names, url_dict),
|
| 78 |
audio_names[I[0][3]].split('.')[0], get_url_myma(I[0][3], audio_names, url_dict),
|
| 79 |
audio_names[I[0][4]].split('.')[0], get_url_myma(I[0][4], audio_names, url_dict)]
|
| 80 |
'''
|
| 81 |
+
'''
|
| 82 |
except:
|
| 83 |
return ["",
|
| 84 |
"Error input - please try again", "",
|
|
|
|
| 111 |
["90 eurodance beat","en"],
|
| 112 |
]
|
| 113 |
|
| 114 |
+
outputs = [gr.File()]
|
| 115 |
+
for i in range(max_output):
|
| 116 |
+
outputs.append(gr.Textbox(label=f"top{i} track name", show_label=True))
|
| 117 |
+
outputs.append(gr.Audio(label=f"top{i}", show_label=False))
|
| 118 |
+
|
| 119 |
+
'''outputs = [gr.File(),
|
| 120 |
gr.Textbox(label="Track name 1"), gr.Audio(label="Track 1", show_label=False),
|
| 121 |
gr.Textbox(label="Track name 2"), gr.Audio(label="Track 2", show_label=False),
|
| 122 |
gr.Textbox(label="Track name 3"), gr.Audio(label="Track 3", show_label=False),
|
| 123 |
gr.Textbox(label="Track name 4"), gr.Audio(label="Track 4", show_label=False),
|
| 124 |
gr.Textbox(label="Track name 5"), gr.Audio(label="Track 5", show_label=False)]
|
| 125 |
+
'''
|
| 126 |
demo1 = gr.Interface(fn=process, inputs=inputs, outputs=outputs, examples=poc_examples, cache_examples=False, examples_per_page=20)
|
| 127 |
|
| 128 |
demo1.launch(debug=False)
|