Spaces:
Build error
Build error
fix variable length not working
Browse files
app.py
CHANGED
|
@@ -32,7 +32,6 @@ from models import *
|
|
| 32 |
|
| 33 |
max_results = 100
|
| 34 |
max_output = 50
|
| 35 |
-
num_results = 0
|
| 36 |
|
| 37 |
# global (faster)
|
| 38 |
ind = get_index()
|
|
@@ -96,12 +95,13 @@ def process(file_name, embed_html_all):
|
|
| 96 |
break
|
| 97 |
|
| 98 |
file = os.path.splitext(os.path.basename(top))[0]
|
| 99 |
-
if file
|
| 100 |
-
|
|
|
|
|
|
|
| 101 |
|
| 102 |
formated.append(file)
|
| 103 |
formated.append(top)
|
| 104 |
-
writer.writerow(dict_catalog[file].values())
|
| 105 |
num_results += 1
|
| 106 |
|
| 107 |
return (embed_html_all, output_csv, *formated)
|
|
@@ -136,7 +136,7 @@ with gr.Blocks() as demo:
|
|
| 136 |
|
| 137 |
with gr.Row():
|
| 138 |
with gr.Column():
|
| 139 |
-
for i in range(
|
| 140 |
tops.append(
|
| 141 |
gr.Textbox(label=f"top{i} track name", show_label=True)
|
| 142 |
)
|
|
|
|
| 32 |
|
| 33 |
max_results = 100
|
| 34 |
max_output = 50
|
|
|
|
| 35 |
|
| 36 |
# global (faster)
|
| 37 |
ind = get_index()
|
|
|
|
| 95 |
break
|
| 96 |
|
| 97 |
file = os.path.splitext(os.path.basename(top))[0]
|
| 98 |
+
if file in dict_catalog:
|
| 99 |
+
writer.writerow(dict_catalog[file].values())
|
| 100 |
+
else:
|
| 101 |
+
writer.writerow([file, "no metadata provided"])
|
| 102 |
|
| 103 |
formated.append(file)
|
| 104 |
formated.append(top)
|
|
|
|
| 105 |
num_results += 1
|
| 106 |
|
| 107 |
return (embed_html_all, output_csv, *formated)
|
|
|
|
| 136 |
|
| 137 |
with gr.Row():
|
| 138 |
with gr.Column():
|
| 139 |
+
for i in range(max_output):
|
| 140 |
tops.append(
|
| 141 |
gr.Textbox(label=f"top{i} track name", show_label=True)
|
| 142 |
)
|