Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,6 @@ def transcribe(inputs, previous_transcription):
|
|
23 |
try:
|
24 |
# Generate a unique filename Using UUID
|
25 |
filename = f"{uuid.uuid4().hex}.wav"
|
26 |
-
filepath = os.path.join(tempfile.gettempdir(), filename)
|
27 |
|
28 |
# Extract Sample Rate and Audio Data from the Tuple
|
29 |
sample_rate, audio_data = inputs
|
@@ -32,7 +31,7 @@ def transcribe(inputs, previous_transcription):
|
|
32 |
scipy.io.wavfile.write(filepath, sample_rate, audio_data)
|
33 |
|
34 |
# Transcribe the Audio
|
35 |
-
transcription = pipe(filepath, batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=
|
36 |
previous_transcription += transcription
|
37 |
|
38 |
# Remove the Temporary File after Transcription
|
|
|
23 |
try:
|
24 |
# Generate a unique filename Using UUID
|
25 |
filename = f"{uuid.uuid4().hex}.wav"
|
|
|
26 |
|
27 |
# Extract Sample Rate and Audio Data from the Tuple
|
28 |
sample_rate, audio_data = inputs
|
|
|
31 |
scipy.io.wavfile.write(filepath, sample_rate, audio_data)
|
32 |
|
33 |
# Transcribe the Audio
|
34 |
+
transcription = pipe(filepath, batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=False)["text"]
|
35 |
previous_transcription += transcription
|
36 |
|
37 |
# Remove the Temporary File after Transcription
|