Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -139,9 +139,12 @@ def audio_function():
|
|
139 |
"assistant_model": assistant_model if parameters.assisted else None
|
140 |
}
|
141 |
|
|
|
|
|
|
|
142 |
|
143 |
asr_outputs = asr_pipeline(
|
144 |
-
|
145 |
chunk_length_s=parameters.chunk_length_s,
|
146 |
batch_size=parameters.batch_size,
|
147 |
generate_kwargs=generate_kwargs,
|
@@ -151,7 +154,7 @@ def audio_function():
|
|
151 |
|
152 |
|
153 |
|
154 |
-
transcript = diarize(diarization_pipeline,
|
155 |
global speech
|
156 |
speech = transcript
|
157 |
return transcript,asr_outputs["chunks"],asr_outputs["text"]
|
|
|
139 |
"assistant_model": assistant_model if parameters.assisted else None
|
140 |
}
|
141 |
|
142 |
+
with open("current_out.wav", 'rb') as f:
|
143 |
+
audio_encoded = base64.b64encode(f.read()).decode("utf-8")
|
144 |
+
file = base64.b64decode(audio_encoded)
|
145 |
|
146 |
asr_outputs = asr_pipeline(
|
147 |
+
file,
|
148 |
chunk_length_s=parameters.chunk_length_s,
|
149 |
batch_size=parameters.batch_size,
|
150 |
generate_kwargs=generate_kwargs,
|
|
|
154 |
|
155 |
|
156 |
|
157 |
+
transcript = diarize(diarization_pipeline, file, parameters, asr_outputs)
|
158 |
global speech
|
159 |
speech = transcript
|
160 |
return transcript,asr_outputs["chunks"],asr_outputs["text"]
|