Spaces:
Runtime error
Runtime error
filename update downloader
Browse files
src/runners/transcription_zipper.py
CHANGED
@@ -18,13 +18,14 @@ class TranscriptionZipper(bentoml.Runnable):
|
|
18 |
|
19 |
for t_list in transcription_list:
|
20 |
orig_filename = t_list[0]
|
|
|
|
|
|
|
|
|
21 |
new_content = create_word_content(orig_filename, t_list[1], t_list[2])
|
22 |
new_content.save(orig_filename + '.docx')
|
23 |
# new_content = create_content(t_list[1], t_list[2]) # html string
|
24 |
-
|
25 |
-
file_name = orig_filename.removesuffix(".mp3")
|
26 |
-
else:
|
27 |
-
file_name = orig_filename.removesuffix(".wav")
|
28 |
with zipfile.ZipFile(zip_buffer, "a") as zip_file:
|
29 |
# zip_file.writestr(file_name + ".html", new_content)
|
30 |
zip_file.write(orig_filename + '.docx')
|
|
|
18 |
|
19 |
for t_list in transcription_list:
|
20 |
orig_filename = t_list[0]
|
21 |
+
if ".mp3" in orig_filename:
|
22 |
+
orig_filename = orig_filename.removesuffix(".mp3")
|
23 |
+
else:
|
24 |
+
orig_filename = orig_filename.removesuffix(".wav")
|
25 |
new_content = create_word_content(orig_filename, t_list[1], t_list[2])
|
26 |
new_content.save(orig_filename + '.docx')
|
27 |
# new_content = create_content(t_list[1], t_list[2]) # html string
|
28 |
+
|
|
|
|
|
|
|
29 |
with zipfile.ZipFile(zip_buffer, "a") as zip_file:
|
30 |
# zip_file.writestr(file_name + ".html", new_content)
|
31 |
zip_file.write(orig_filename + '.docx')
|