omarxadel commited on
Commit
95f30a9
1 Parent(s): 3ec577a

Updated workspace code to fix errors

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. requirements.txt +0 -0
app.py CHANGED
@@ -1,10 +1,10 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
- import requests
4
- import os
5
 
6
  transcriber = pipeline("automatic-speech-recognition", model="omarxadel/hubert-large-arabic-egyptian")
7
 
 
8
  def transcribe(stream, new_chunk):
9
  sr, y = new_chunk
10
  y = y.astype(np.float32)
@@ -19,7 +19,7 @@ def transcribe(stream, new_chunk):
19
 
20
  demo = gr.Interface(
21
  transcribe,
22
- ["state", gr.Audio(source="microphone", streaming=True)],
23
  ["state", "text"],
24
  live=True,
25
  )
 
1
  from transformers import pipeline
2
  import gradio as gr
3
+ import numpy as np
 
4
 
5
  transcriber = pipeline("automatic-speech-recognition", model="omarxadel/hubert-large-arabic-egyptian")
6
 
7
+
8
  def transcribe(stream, new_chunk):
9
  sr, y = new_chunk
10
  y = y.astype(np.float32)
 
19
 
20
  demo = gr.Interface(
21
  transcribe,
22
+ ["state", gr.Audio(sources=["microphone"], streaming=True)],
23
  ["state", "text"],
24
  live=True,
25
  )
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ