Hunzla commited on
Commit
87f11c1
1 Parent(s): 2beaf00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,7 +2,7 @@ from transformers import pipeline
2
  asr_pipe = pipeline("automatic-speech-recognition", model="Abdullah17/whisper-small-urdu")
3
  from difflib import SequenceMatcher
4
  import json
5
- with open("tasks.json", "r") as json_file:
6
  urdu_data = json.load(json_file)
7
  # List of commands
8
  # commands = [
@@ -33,7 +33,7 @@ def find_most_similar_command(statement, command_list):
33
  return best_match,reply
34
  def transcribe_the_command(audio,id):
35
  import soundfile as sf
36
- commands=urdu_data[0]
37
  print(commands)
38
  sample_rate, audio_data = audio
39
  file_name = "recorded_audio.wav"
 
2
  asr_pipe = pipeline("automatic-speech-recognition", model="Abdullah17/whisper-small-urdu")
3
  from difflib import SequenceMatcher
4
  import json
5
+ with open("tasks.json", "r", encoding="utf-8") as json_file:
6
  urdu_data = json.load(json_file)
7
  # List of commands
8
  # commands = [
 
33
  return best_match,reply
34
  def transcribe_the_command(audio,id):
35
  import soundfile as sf
36
+ commands=urdu_data[id]
37
  print(commands)
38
  sample_rate, audio_data = audio
39
  file_name = "recorded_audio.wav"