michaeltangz commited on
Commit ·
ae149f3
1
Parent(s): aebccdb
refactor app.py to enhance transcription pipeline by adding condition_on_previous_text parameter; improve transcription accuracy
Browse files
app.py
CHANGED
|
@@ -71,7 +71,11 @@ def stream_transcribe(stream, new_chunk):
|
|
| 71 |
else:
|
| 72 |
stream = y
|
| 73 |
|
| 74 |
-
transcription = pipe(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
end_time = time.time()
|
| 76 |
latency = end_time - start_time
|
| 77 |
|
|
|
|
| 71 |
else:
|
| 72 |
stream = y
|
| 73 |
|
| 74 |
+
transcription = pipe(
|
| 75 |
+
{"sampling_rate": sr, "raw": stream},
|
| 76 |
+
generate_kwargs={
|
| 77 |
+
"language": "english",
|
| 78 |
+
"condition_on_previous_text": False })['text']
|
| 79 |
end_time = time.time()
|
| 80 |
latency = end_time - start_time
|
| 81 |
|