Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
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}."
|