TaiYouWeb commited on
Commit
e8db4c4
1 Parent(s): 15ad32c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -20
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
- try:
44
- # 生成结果
45
- res = model.generate(
46
- input=temp_file_path, # 使用文件路径作为输入
47
- cache={},
48
- language=language,
49
- use_itn=use_itn,
50
- batch_size_s=batch_size_s,
51
- merge_vad=merge_vad,
52
- merge_length_s=merge_length_s,
53
- batch_size_threshold_s=batch_size_threshold_s,
54
- hotword=hotword,
55
- spk_model=spk_model,
56
- ban_emo_unk=ban_emo_unk
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界面