Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,28 +40,28 @@ def transcribe_audio(file_path, vad_model="fsmn-vad", vad_kwargs='{"max_single_s
|
|
40 |
# 使用文件路径作为输入
|
41 |
temp_file_path = file_path
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
# 处理结果
|
60 |
-
text = rich_transcription_postprocess(res[0]["text"])
|
61 |
-
|
62 |
-
return text
|
63 |
-
|
64 |
except Exception as e:
|
|
|
65 |
return str(e)
|
66 |
|
67 |
# 创建Gradio界面
|
|
|
40 |
# 使用文件路径作为输入
|
41 |
temp_file_path = file_path
|
42 |
|
43 |
+
# 生成结果
|
44 |
+
res = model.generate(
|
45 |
+
input=temp_file_path, # 使用文件路径作为输入
|
46 |
+
cache={},
|
47 |
+
language=language,
|
48 |
+
use_itn=use_itn,
|
49 |
+
batch_size_s=batch_size_s,
|
50 |
+
merge_vad=merge_vad,
|
51 |
+
merge_length_s=merge_length_s,
|
52 |
+
batch_size_threshold_s=batch_size_threshold_s,
|
53 |
+
hotword=hotword,
|
54 |
+
spk_model=spk_model,
|
55 |
+
ban_emo_unk=ban_emo_unk
|
56 |
+
)
|
57 |
+
|
58 |
+
# 处理结果
|
59 |
+
text = rich_transcription_postprocess(res[0]["text"])
|
60 |
+
|
61 |
+
return text
|
62 |
|
|
|
|
|
|
|
|
|
|
|
63 |
except Exception as e:
|
64 |
+
# 捕获异常并返回错误信息
|
65 |
return str(e)
|
66 |
|
67 |
# 创建Gradio界面
|