DurreSudoku commited on
Commit
1ff72eb
·
verified ·
1 Parent(s): e024f8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ import logging
8
 
9
  all_images = os.listdir("assets")
10
  current_image = None
11
- pipe = pipeline(model="DurreSudoku/whisper-small-sv") # change to "your-username/the-name-you-picked"
12
 
13
  def test_func():
14
  random_int = random.randint(1, 100)
@@ -67,7 +67,7 @@ def transcribe(audio_input):
67
  for text in text_list:
68
  match_ratio = SequenceMatcher(None, text, correct_answer).ratio()
69
 
70
- if match_ratio >= 0.8:
71
  return f"The answer is {correct_answer}. I heard {text}."
72
  # If no match is found.
73
  return f"The correct answer is {correct_answer}. I heard {transcribed_audio}."
 
8
 
9
  all_images = os.listdir("assets")
10
  current_image = None
11
+ pipe = pipeline(task="automatic-speech-recognition", model="DurreSudoku/whisper-small-sv", processor="openai/whisper-small") # change to "your-username/the-name-you-picked"
12
 
13
  def test_func():
14
  random_int = random.randint(1, 100)
 
67
  for text in text_list:
68
  match_ratio = SequenceMatcher(None, text, correct_answer).ratio()
69
 
70
+ if match_ratio >= 0.75:
71
  return f"The answer is {correct_answer}. I heard {text}."
72
  # If no match is found.
73
  return f"The correct answer is {correct_answer}. I heard {transcribed_audio}."