Kamtera commited on
Commit
fd4e0e8
1 Parent(s): b98b502

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -184,7 +184,7 @@ var INLINE_JSON='''
184
  html_seeker2=''';
185
  update();
186
  </script>'''
187
- '''
188
  model_name = "voidful/wav2vec2-xlsr-multilingual-56"
189
  model0 = pipeline(task="automatic-speech-recognition",
190
  model=model_name)
@@ -196,17 +196,16 @@ model2 = pipeline(task="automatic-speech-recognition",
196
  model_name = "ghofrani/common8"
197
  model1 = pipeline(task="automatic-speech-recognition",
198
  model=model_name)
199
- '''
200
  import json
201
  def predict_fa(speech,model):
202
- '''if model== "SLPL/Sharif-wav2vec2":
203
  text = model2(speech,return_timestamps="word" )
204
  elif model== "ghofrani/common8":
205
  text = model1(speech,return_timestamps="word" )
206
  elif model== "voidful/wav2vec2-xlsr-multilingual-56":
207
  text = model0(speech,return_timestamps="word" )
208
- '''
209
- text={"text": "\u0627\u06cc\u0646\u0627\u0646 \u06a9\u0631\u0627\u0644\u0627\u0644 \u0648 \u06a9\u0648\u0631\u0646\u062f \u0648 \u0644\u0632\u0627 \u0627\u0632 \u06af\u0645\u0631\u0627\u0647\u06cc \u0628\u0647 \u0631\u0627\u0647 \u0628\u0627\u0632 \u0646\u0645\u06cc\u06a9\u0631\u062f\u0646\u062f", "chunks": [{"text": "\u0627\u06cc\u0646\u0627\u0646", "timestamp": [0.0, 0.72]}, {"text": "\u06a9\u0631\u0627\u0644\u0627\u0644", "timestamp": [0.92, 1.6]}, {"text": "\u0648", "timestamp": [1.72, 1.74]}, {"text": "\u06a9\u0648\u0631\u0646\u062f", "timestamp": [1.9, 2.54]}, {"text": "\u0648", "timestamp": [2.76, 2.78]}, {"text": "\u0644\u0632\u0627", "timestamp": [2.88, 3.16]}, {"text": "\u0627\u0632", "timestamp": [3.4, 3.5]}, {"text": "\u06af\u0645\u0631\u0627\u0647\u06cc", "timestamp": [3.64, 4.3]}, {"text": "\u0628\u0647", "timestamp": [4.6, 4.68]}, {"text": "\u0631\u0627\u0647", "timestamp": [4.78, 5.12]}, {"text": "\u0628\u0627\u0632", "timestamp": [5.3, 5.58]}, {"text": "\u0646\u0645\u06cc\u06a9\u0631\u062f\u0646\u062f", "timestamp": [5.68, 7.14]}]}
210
  return [text['text'],json.dumps(text),html_seeker+json.dumps(text)+html_seeker2]
211
 
212
 
 
184
  html_seeker2=''';
185
  update();
186
  </script>'''
187
+
188
  model_name = "voidful/wav2vec2-xlsr-multilingual-56"
189
  model0 = pipeline(task="automatic-speech-recognition",
190
  model=model_name)
 
196
  model_name = "ghofrani/common8"
197
  model1 = pipeline(task="automatic-speech-recognition",
198
  model=model_name)
199
+
200
  import json
201
  def predict_fa(speech,model):
202
+ if model== "SLPL/Sharif-wav2vec2":
203
  text = model2(speech,return_timestamps="word" )
204
  elif model== "ghofrani/common8":
205
  text = model1(speech,return_timestamps="word" )
206
  elif model== "voidful/wav2vec2-xlsr-multilingual-56":
207
  text = model0(speech,return_timestamps="word" )
208
+
 
209
  return [text['text'],json.dumps(text),html_seeker+json.dumps(text)+html_seeker2]
210
 
211