JacobLinCool commited on
Commit
c3b43a8
·
1 Parent(s): ae60597

fix: reorder model choices and update example files to use PHI model

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -20,10 +20,13 @@ logger = logging.getLogger(__name__)
20
 
21
  # Constants
22
  EXAMPLES_DIR = Path("./examples")
23
- MODEL_CHOICES = {WHISPER_MODEL_ID: "Whisper Model", PHI_MODEL_ID: "Phi-4 Model"}
 
 
 
24
  EXAMPLE_FILES = [
25
- (str(EXAMPLES_DIR / "audio1.mp3"), WHISPER_MODEL_ID),
26
- (str(EXAMPLES_DIR / "audio2.mp3"), WHISPER_MODEL_ID),
27
  ]
28
 
29
 
@@ -91,7 +94,7 @@ def create_demo() -> gr.Blocks:
91
  model_choice = gr.Dropdown(
92
  label="Select Model",
93
  choices=list(MODEL_CHOICES.keys()),
94
- value=WHISPER_MODEL_ID,
95
  info="Select the model for transcription",
96
  )
97
  text_output = gr.Textbox(label="Transcription Output", lines=5)
@@ -114,7 +117,7 @@ def create_demo() -> gr.Blocks:
114
  )
115
 
116
  gr.Examples(
117
- EXAMPLE_FILES,
118
  inputs=[audio_input, model_choice],
119
  outputs=[text_output],
120
  fn=combined_transcription,
 
20
 
21
  # Constants
22
  EXAMPLES_DIR = Path("./examples")
23
+ MODEL_CHOICES = {
24
+ PHI_MODEL_ID: "Phi-4 Model",
25
+ WHISPER_MODEL_ID: "Whisper Model",
26
+ }
27
  EXAMPLE_FILES = [
28
+ [str(EXAMPLES_DIR / "audio1.mp3"), PHI_MODEL_ID],
29
+ [str(EXAMPLES_DIR / "audio2.mp3"), PHI_MODEL_ID],
30
  ]
31
 
32
 
 
94
  model_choice = gr.Dropdown(
95
  label="Select Model",
96
  choices=list(MODEL_CHOICES.keys()),
97
+ value=PHI_MODEL_ID,
98
  info="Select the model for transcription",
99
  )
100
  text_output = gr.Textbox(label="Transcription Output", lines=5)
 
117
  )
118
 
119
  gr.Examples(
120
+ examples=EXAMPLE_FILES,
121
  inputs=[audio_input, model_choice],
122
  outputs=[text_output],
123
  fn=combined_transcription,