Hunzla commited on
Commit
1fe563d
1 Parent(s): 761c854

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from transformers import pipeline
 
2
  transcript_pipe = pipeline("automatic-speech-recognition", model="ihanif/whisper-medium-urdu")
3
  from difflib import SequenceMatcher
4
  import json
@@ -32,7 +33,10 @@ def find_most_similar_command(statement, command_list):
32
  highest_similarity = similarity
33
  best_match = command
34
  reply=index
35
- return best_match,reply
 
 
 
36
 
37
  def transcribe_the_command(audio,menu_id,abc):
38
  import soundfile as sf
 
1
  from transformers import pipeline
2
+ asr_pipe = pipeline("automatic-speech-recognition", model="Abdullah17/whisper-small-urdu")
3
  transcript_pipe = pipeline("automatic-speech-recognition", model="ihanif/whisper-medium-urdu")
4
  from difflib import SequenceMatcher
5
  import json
 
33
  highest_similarity = similarity
34
  best_match = command
35
  reply=index
36
+ if highest_similarity > 0.7:
37
+ return best_match,reply
38
+ else:
39
+ return "repeat_command",404
40
 
41
  def transcribe_the_command(audio,menu_id,abc):
42
  import soundfile as sf