Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,9 +41,14 @@ def summarize_and_speech(pdf_file):
|
|
| 41 |
summary = summarization(abstract_text, max_length=15, min_length=10)[0]['summary_text']
|
| 42 |
|
| 43 |
tts_output = synthesiser(summary)
|
| 44 |
-
audio_data = tts_output["audio"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
return summary,
|
| 47 |
|
| 48 |
iface = gr.Interface(
|
| 49 |
fn=summarize_and_speech,
|
|
|
|
| 41 |
summary = summarization(abstract_text, max_length=15, min_length=10)[0]['summary_text']
|
| 42 |
|
| 43 |
tts_output = synthesiser(summary)
|
| 44 |
+
audio_data = tts_output[0]["audio"]
|
| 45 |
+
|
| 46 |
+
# Convert audio data to bytes
|
| 47 |
+
audio_bytes = BytesIO(audio_data)
|
| 48 |
+
audio_bytes.seek(0)
|
| 49 |
+
audio_bytes = audio_bytes.read()
|
| 50 |
|
| 51 |
+
return summary, audio_bytes
|
| 52 |
|
| 53 |
iface = gr.Interface(
|
| 54 |
fn=summarize_and_speech,
|