Spaces:
Runtime error
Runtime error
marianna13
commited on
Commit
•
d11cee1
1
Parent(s):
427f16d
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def sample_df():
|
|
57 |
audio_path = download_and_save_file(audio_url, audio_dir)
|
58 |
sibling_elems = ast.literal_eval(sibling_elems)
|
59 |
sibling_elems = [s.replace('\n', '') for s in sibling_elems]
|
60 |
-
sibling_elems = [s for s in sibling_elems if len(s) > 0]
|
61 |
sibling_elems = list(set(sibling_elems))
|
62 |
img_metadata = ast.literal_eval(img_metadata)
|
63 |
if len(img_metadata) > 0:
|
@@ -77,6 +77,7 @@ def audio_demo(siblings, page_title, audio_meta, audio, annotator, audio_url):
|
|
77 |
df['caption'].loc[df['audio_url'] == audio_url] = cap
|
78 |
df['annotator'].loc[df['audio_url'] == audio_url] = annotator
|
79 |
worksheet.update([df.columns.values.tolist()] + df.values.tolist())
|
|
|
80 |
return 'success!'
|
81 |
|
82 |
audio_path, audio_url, sibling_elems, audio_meta, page_title, df, worksheet = sample_df()
|
@@ -98,5 +99,4 @@ iface = gr.Interface(
|
|
98 |
)
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
-
iface.launch(show_error=True, debug=True)
|
102 |
-
audio_path, audio_url, sibling_elems, audio_meta, page_title, df, worksheet = sample_df()
|
|
|
57 |
audio_path = download_and_save_file(audio_url, audio_dir)
|
58 |
sibling_elems = ast.literal_eval(sibling_elems)
|
59 |
sibling_elems = [s.replace('\n', '') for s in sibling_elems]
|
60 |
+
sibling_elems = [wrap(s) for s in sibling_elems if len(s) > 0]
|
61 |
sibling_elems = list(set(sibling_elems))
|
62 |
img_metadata = ast.literal_eval(img_metadata)
|
63 |
if len(img_metadata) > 0:
|
|
|
77 |
df['caption'].loc[df['audio_url'] == audio_url] = cap
|
78 |
df['annotator'].loc[df['audio_url'] == audio_url] = annotator
|
79 |
worksheet.update([df.columns.values.tolist()] + df.values.tolist())
|
80 |
+
audio_path, audio_url, sibling_elems, audio_meta, page_title, df, worksheet = sample_df()
|
81 |
return 'success!'
|
82 |
|
83 |
audio_path, audio_url, sibling_elems, audio_meta, page_title, df, worksheet = sample_df()
|
|
|
99 |
)
|
100 |
|
101 |
if __name__ == "__main__":
|
102 |
+
iface.launch(show_error=True, debug=True)
|
|