TaiYouWeb commited on
Commit
4872dd1
1 Parent(s): a38ec52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -21,15 +21,16 @@ model = AutoModel(
21
  trust_remote_code=False,
22
  remote_code="./model.py",
23
  vad_model="fsmn-vad",
 
24
  vad_kwargs={"max_single_segment_time": 30000},
25
- ncpu=4,
26
  batch_size=1,
27
- hub="ms",
28
  device=device,
29
  )
30
 
31
- def transcribe_audio(file_path, vad_model="fsmn-vad", vad_kwargs='{"max_single_segment_time": 30000}',
32
- ncpu=4, batch_size=1, language="auto", use_itn=True, batch_size_s=60,
33
  merge_vad=True, merge_length_s=15, batch_size_threshold_s=50,
34
  hotword=" ", spk_model="cam++", ban_emo_unk=False):
35
  try:
@@ -61,8 +62,8 @@ def transcribe_audio(file_path, vad_model="fsmn-vad", vad_kwargs='{"max_single_s
61
  inputs = [
62
  gr.Audio(type="filepath"),
63
  gr.Textbox(value="fsmn-vad", label="VAD Model"),
 
64
  gr.Textbox(value='{"max_single_segment_time": 30000}', label="VAD Kwargs"),
65
- gr.Slider(1, 8, value=4, step=1, label="NCPU"),
66
  gr.Slider(1, 10, value=1, step=1, label="Batch Size"),
67
  gr.Textbox(value="auto", label="Language"),
68
  gr.Checkbox(value=True, label="Use ITN"),
 
21
  trust_remote_code=False,
22
  remote_code="./model.py",
23
  vad_model="fsmn-vad",
24
+ punc_model="ct-punc",
25
  vad_kwargs={"max_single_segment_time": 30000},
26
+ ncpu=torch.get_num_threads(),
27
  batch_size=1,
28
+ hub="hf",
29
  device=device,
30
  )
31
 
32
+ def transcribe_audio(file_path, vad_model="fsmn-vad", punc_model="ct-punc", vad_kwargs='{"max_single_segment_time": 30000}',
33
+ batch_size=1, language="auto", use_itn=True, batch_size_s=60,
34
  merge_vad=True, merge_length_s=15, batch_size_threshold_s=50,
35
  hotword=" ", spk_model="cam++", ban_emo_unk=False):
36
  try:
 
62
  inputs = [
63
  gr.Audio(type="filepath"),
64
  gr.Textbox(value="fsmn-vad", label="VAD Model"),
65
+ gr.Textbox(value="ct-punc", label="PUNC Model"),
66
  gr.Textbox(value='{"max_single_segment_time": 30000}', label="VAD Kwargs"),
 
67
  gr.Slider(1, 10, value=1, step=1, label="Batch Size"),
68
  gr.Textbox(value="auto", label="Language"),
69
  gr.Checkbox(value=True, label="Use ITN"),