Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -253,12 +253,12 @@ def phon(text):
|
|
| 253 |
|
| 254 |
|
| 255 |
def gradio_fn(text, audio, target, actual_audio):
|
| 256 |
-
if text
|
| 257 |
return "No Inputs", "No Inputs", "No Inputs", "No Inputs"
|
| 258 |
speech_score = 0
|
| 259 |
div = calculate_diversity(text)
|
| 260 |
|
| 261 |
-
if actual_audio
|
| 262 |
actual = p(actual_audio)["text"]
|
| 263 |
print('sdfgs')
|
| 264 |
speech_score = compute_score(target, actual)
|
|
@@ -267,7 +267,7 @@ def gradio_fn(text, audio, target, actual_audio):
|
|
| 267 |
actual.lower()), "Diversity Score: " + str(div[1]), "Speech Score: " + str(speech_score)
|
| 268 |
|
| 269 |
transcription = []
|
| 270 |
-
if audio
|
| 271 |
text = p(audio)["text"]
|
| 272 |
transcription.append(text)
|
| 273 |
state = div[0]
|
|
|
|
| 253 |
|
| 254 |
|
| 255 |
def gradio_fn(text, audio, target, actual_audio):
|
| 256 |
+
if text is None and audio is None and target is None and actual_audio is None:
|
| 257 |
return "No Inputs", "No Inputs", "No Inputs", "No Inputs"
|
| 258 |
speech_score = 0
|
| 259 |
div = calculate_diversity(text)
|
| 260 |
|
| 261 |
+
if actual_audio is not None:
|
| 262 |
actual = p(actual_audio)["text"]
|
| 263 |
print('sdfgs')
|
| 264 |
speech_score = compute_score(target, actual)
|
|
|
|
| 267 |
actual.lower()), "Diversity Score: " + str(div[1]), "Speech Score: " + str(speech_score)
|
| 268 |
|
| 269 |
transcription = []
|
| 270 |
+
if audio is not None:
|
| 271 |
text = p(audio)["text"]
|
| 272 |
transcription.append(text)
|
| 273 |
state = div[0]
|