Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def format_timestamp(seconds: float, always_include_hours: bool = False, decimal
|
|
38 |
return seconds
|
39 |
|
40 |
|
41 |
-
def transcribe(file,
|
42 |
outputs = pipe(file, batch_size=BATCH_SIZE, return_timestamps=return_timestamps)
|
43 |
text = outputs["text"]
|
44 |
if return_timestamps:
|
@@ -50,7 +50,7 @@ def transcribe(file, string, return_timestamps):
|
|
50 |
text = "\n".join(str(feature) for feature in timestamps)
|
51 |
text_nopunc = text.translate(str.maketrans('', '', string.punctuation))
|
52 |
grade = ''
|
53 |
-
if text_nopunc.lower() ==
|
54 |
grade = "good!"
|
55 |
else:
|
56 |
grade = "could use some work..."
|
|
|
38 |
return seconds
|
39 |
|
40 |
|
41 |
+
def transcribe(file, og_text, return_timestamps):
|
42 |
outputs = pipe(file, batch_size=BATCH_SIZE, return_timestamps=return_timestamps)
|
43 |
text = outputs["text"]
|
44 |
if return_timestamps:
|
|
|
50 |
text = "\n".join(str(feature) for feature in timestamps)
|
51 |
text_nopunc = text.translate(str.maketrans('', '', string.punctuation))
|
52 |
grade = ''
|
53 |
+
if text_nopunc.lower() == og_text.lower():
|
54 |
grade = "good!"
|
55 |
else:
|
56 |
grade = "could use some work..."
|