jlvdoorn commited on
Commit
6056819
1 Parent(s): 516ddf0

Refactor audio input and output

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -13,7 +13,7 @@ examples = examples_atco2 #+ examples_atcosim
13
 
14
  whisper = pipeline(model='jlvdoorn/whisper-large-v3-atco2-asr-atcosim')
15
 
16
- def transcribe(audio, model_version):
17
  if audio is not None:
18
  return whisper(audio)['text']
19
  else:
@@ -21,12 +21,9 @@ def transcribe(audio, model_version):
21
 
22
  file_iface = gr.Interface(
23
  fn = transcribe,
24
- inputs = [gr.Audio(source='upload', interactive=True),
25
- gr.Checkbox(label='Transcribe only', default=False),
26
- gr.Dropdown(choices=['large-v2', 'large-v3'], value='large-v3', label='Whisper model version')
27
- ],
28
 
29
- outputs = [gr.Textbox(label='Transcription'), gr.Textbox(label='Callsigns, commands and values')],
30
  title = 'Whisper ATC - Large v3',
31
  description = 'Transcribe ATC speech',
32
  # examples = examples,
@@ -34,12 +31,9 @@ file_iface = gr.Interface(
34
 
35
  mic_iface = gr.Interface(
36
  fn = transcribe,
37
- inputs = [gr.Audio(source='microphone', type='filepath'),
38
- gr.Checkbox(label='Transcribe only', default=False),
39
- gr.Dropdown(choices=['large-v2', 'large-v3'], value='large-v3', label='Whisper model version')
40
- ],
41
 
42
- outputs = [gr.Textbox(label='Transcription'), gr.Textbox(label='Callsigns, commands and values')],
43
  title = 'Whisper ATC - Large v3',
44
  description = 'Transcribe ATC speech',
45
  )
 
13
 
14
  whisper = pipeline(model='jlvdoorn/whisper-large-v3-atco2-asr-atcosim')
15
 
16
+ def transcribe(audio):
17
  if audio is not None:
18
  return whisper(audio)['text']
19
  else:
 
21
 
22
  file_iface = gr.Interface(
23
  fn = transcribe,
24
+ inputs = gr.Audio(source='upload', interactive=True),
 
 
 
25
 
26
+ outputs = gr.Textbox(label='Transcription'),
27
  title = 'Whisper ATC - Large v3',
28
  description = 'Transcribe ATC speech',
29
  # examples = examples,
 
31
 
32
  mic_iface = gr.Interface(
33
  fn = transcribe,
34
+ inputs = gr.Audio(source='microphone', type='filepath'),
 
 
 
35
 
36
+ outputs = gr.Textbox(label='Transcription'),
37
  title = 'Whisper ATC - Large v3',
38
  description = 'Transcribe ATC speech',
39
  )