Spaces:
Runtime error
Runtime error
MingLi
commited on
Commit
·
1efcf52
1
Parent(s):
710fddf
bug fix
Browse files
app.py
CHANGED
@@ -63,6 +63,8 @@ def ffmpeg_convert(file_input, file_output):
|
|
63 |
def handel_files(f_ls):
|
64 |
files = []
|
65 |
for file in f_ls:
|
|
|
|
|
66 |
if file.endswith(".m4a"):
|
67 |
file_output = file.replace(".m4a", ".wav")
|
68 |
ffmpeg_convert(file, file_output)
|
@@ -72,9 +74,12 @@ def handel_files(f_ls):
|
|
72 |
elif file.endswith(".wav"):
|
73 |
file_output = file
|
74 |
ffmpeg_convert(file, file_output)
|
|
|
|
|
|
|
75 |
else:
|
76 |
gr.Warning(f"存在不合法文件{os.path.basename(file)},已跳过处理")
|
77 |
-
|
78 |
ret = []
|
79 |
for file in files:
|
80 |
ret.append(whisper_handler(file))
|
|
|
63 |
def handel_files(f_ls):
|
64 |
files = []
|
65 |
for file in f_ls:
|
66 |
+
|
67 |
+
file_output=None
|
68 |
if file.endswith(".m4a"):
|
69 |
file_output = file.replace(".m4a", ".wav")
|
70 |
ffmpeg_convert(file, file_output)
|
|
|
74 |
elif file.endswith(".wav"):
|
75 |
file_output = file
|
76 |
ffmpeg_convert(file, file_output)
|
77 |
+
|
78 |
+
if file_output:
|
79 |
+
files.append(file_output)
|
80 |
else:
|
81 |
gr.Warning(f"存在不合法文件{os.path.basename(file)},已跳过处理")
|
82 |
+
|
83 |
ret = []
|
84 |
for file in files:
|
85 |
ret.append(whisper_handler(file))
|