Core23 commited on
Commit
7dc5cf4
·
verified ·
1 Parent(s): 248c941

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -8,13 +8,10 @@ pipe = pipeline(model="Ussen/whisper-medium-swc-drc-kat-1")
8
  def transcribe_with_timing(audio):
9
  # Start timing
10
  start_time = time.time()
11
-
12
  # Perform transcription
13
  text = pipe(audio)["text"]
14
-
15
  # Calculate elapsed time
16
  elapsed_time = time.time() - start_time
17
-
18
  return text, f"Transcription time: {elapsed_time:.2f} seconds"
19
 
20
  # Create Gradio interface
@@ -28,8 +25,6 @@ demo = gr.Interface(
28
  description="Rekodi sauti yako na upate maandishi (Swahili ASR)",
29
  live=True
30
  )
31
- # Enable the queue to handle POST requests
32
- interface.queue(api_open=True)
33
 
34
- # Launch the interface
35
- interface.launch()
 
8
  def transcribe_with_timing(audio):
9
  # Start timing
10
  start_time = time.time()
 
11
  # Perform transcription
12
  text = pipe(audio)["text"]
 
13
  # Calculate elapsed time
14
  elapsed_time = time.time() - start_time
 
15
  return text, f"Transcription time: {elapsed_time:.2f} seconds"
16
 
17
  # Create Gradio interface
 
25
  description="Rekodi sauti yako na upate maandishi (Swahili ASR)",
26
  live=True
27
  )
 
 
28
 
29
+ demo.queue(api_open=True)
30
+ demo.launch()