Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,11 +39,11 @@ def parse(wav_file):
|
|
| 39 |
logits = model(**input_values).logits
|
| 40 |
sentence = parse_transcription(logits)
|
| 41 |
check_spell = spell_checker.check(sentence)
|
| 42 |
-
if check_spell[0]
|
| 43 |
-
|
| 44 |
-
elif check_spell[0]
|
| 45 |
-
|
| 46 |
-
return
|
| 47 |
|
| 48 |
|
| 49 |
model_id = "jonatasgrosman/wav2vec2-large-xlsr-53-persian"
|
|
|
|
| 39 |
logits = model(**input_values).logits
|
| 40 |
sentence = parse_transcription(logits)
|
| 41 |
check_spell = spell_checker.check(sentence)
|
| 42 |
+
if check_spell[0] is False:
|
| 43 |
+
corrected = check_spell[1]
|
| 44 |
+
elif check_spell[0] is True:
|
| 45 |
+
corrected = sentence
|
| 46 |
+
return corrected
|
| 47 |
|
| 48 |
|
| 49 |
model_id = "jonatasgrosman/wav2vec2-large-xlsr-53-persian"
|