ndelworth08 commited on
Commit
6458569
1 Parent(s): bb47424

switching verbatimicity parameter name

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -45,29 +45,30 @@ def recognition(audio, style=0):
45
  return "Input Error! Please enter one audio!"
46
  # NOTE: model supports 16k sample_rate
47
 
48
- cat_embs = ','.join([str(s) for s in (1-style, style)])
49
  cat_embs = process_cat_embs(cat_embs)
50
  ans = model.transcribe(audio, cat_embs = cat_embs)
51
 
52
  if ans is None:
53
  return "ERROR! No text output! Please try again!"
54
  txt = ans['text']
 
55
  return txt
56
 
57
 
58
  # input
59
  inputs = [
60
  gr.inputs.Audio(source="microphone", type="filepath", label='Input audio'),
61
- gr.Slider(0, 1, value=0, label="Style - from verbatim (0) to non-verbatim (1)", info="Choose between verbatim and NV"),
62
  ]
63
 
64
  output = gr.outputs.Textbox(label="Output Text")
65
 
66
- text = "Reginald Demo"
67
 
68
  # description
69
  description = (
70
- "This is a speech recognition demo that supports verbatim and non-verbatim transcription. Try recording an audio with disfluencies (ex: \'uh\', \'um\') and testing both transcription styles." # noqa
71
  )
72
 
73
  article = (
 
45
  return "Input Error! Please enter one audio!"
46
  # NOTE: model supports 16k sample_rate
47
 
48
+ cat_embs = ','.join([str(s) for s in (style, 1-style)])
49
  cat_embs = process_cat_embs(cat_embs)
50
  ans = model.transcribe(audio, cat_embs = cat_embs)
51
 
52
  if ans is None:
53
  return "ERROR! No text output! Please try again!"
54
  txt = ans['text']
55
+ txt = txt.replace('▁', ' ')
56
  return txt
57
 
58
 
59
  # input
60
  inputs = [
61
  gr.inputs.Audio(source="microphone", type="filepath", label='Input audio'),
62
+ gr.Slider(0, 1, value=0, label="Verbatimicity - from non-verbatim (0) to verbatim (1)", info="Choose a transcription style between non-verbatim and verbatim"),
63
  ]
64
 
65
  output = gr.outputs.Textbox(label="Output Text")
66
 
67
+ text = "Reginald Transcription Styles Demo"
68
 
69
  # description
70
  description = (
71
+ "Reginald supports verbatim and non-verbatim transcription. Try recording an audio with disfluencies (ex: \'uh\', \'um\') and testing both transcription styles." # noqa
72
  )
73
 
74
  article = (