Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,31 +41,31 @@ def download_audio(id_video):
|
|
| 41 |
|
| 42 |
def process_url(input_path):
|
| 43 |
# setup the client
|
| 44 |
-
try :
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
except:
|
| 48 |
-
|
| 49 |
|
| 50 |
def process_file(input_path):
|
| 51 |
return process(input_path, '')[1:]
|
| 52 |
|
| 53 |
def process(audio_file, embed_html_all):
|
| 54 |
-
try :
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
except:
|
| 67 |
return embed_html_all, "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", ""
|
| 68 |
-
|
| 69 |
with gr.Blocks() as demo:
|
| 70 |
|
| 71 |
with gr.Row():
|
|
|
|
| 41 |
|
| 42 |
def process_url(input_path):
|
| 43 |
# setup the client
|
| 44 |
+
#try :
|
| 45 |
+
audio_file, audio_file, embed_html_all = download_audio(input_path)
|
| 46 |
+
return process(audio_file, embed_html_all)
|
| 47 |
+
#except:
|
| 48 |
+
# return "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", ""
|
| 49 |
|
| 50 |
def process_file(input_path):
|
| 51 |
return process(input_path, '')[1:]
|
| 52 |
|
| 53 |
def process(audio_file, embed_html_all):
|
| 54 |
+
'''try : '''
|
| 55 |
+
emb, ts = get_embed(audio_file)
|
| 56 |
+
ind = get_index()
|
| 57 |
+
ind_filenames = get_audio_names()
|
| 58 |
+
catalog = get_catalog()
|
| 59 |
+
url_dict = get_durl_myma()
|
| 60 |
|
| 61 |
+
timestart = time.time()
|
| 62 |
+
_, I = do_search(emb, ind)
|
| 63 |
+
print("search time :", time.time()-timestart)
|
| 64 |
+
top1, top2, top3, top4, top5, top6, top7, top8, top9, top10 = get_top(I, ind_filenames, url_dict, catalog)
|
| 65 |
+
return embed_html_all, ind_filenames[I[0][0]].split('.')[0], top1, ind_filenames[I[0][1]].split('.')[0], top2, ind_filenames[I[0][2]].split('.')[0], top3, ind_filenames[I[0][3]].split('.')[0], top4, ind_filenames[I[0][4]].split('.')[0], top5, ind_filenames[I[0][5]].split('.')[0], top6, ind_filenames[I[0][6]].split('.')[0], top7, ind_filenames[I[0][7]].split('.')[0], top8, ind_filenames[I[0][8]].split('.')[0], top9, ind_filenames[I[0][9]].split('.')[0], top10
|
| 66 |
+
'''except:
|
| 67 |
return embed_html_all, "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", "", "Erreur Input", ""
|
| 68 |
+
'''
|
| 69 |
with gr.Blocks() as demo:
|
| 70 |
|
| 71 |
with gr.Row():
|