Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,7 @@ def summarize_text(results):
|
|
94 |
if summarizer is None:
|
95 |
return "Summarization model could not be loaded."
|
96 |
logger.info("Successfully loaded summarization Model")
|
97 |
-
full_text = ''.join(item['translated'] for item in results if 'translated' in item)
|
98 |
logger.info(f"\n\nWorking on text:\n{full_text}")
|
99 |
summary = summarizer( full_text, max_length=150, min_length=50, do_sample=False)[0]['summary_text']
|
100 |
return summary
|
@@ -157,10 +157,11 @@ with gr.Blocks() as iface:
|
|
157 |
# outputs=[transcription_output, full_text_output]
|
158 |
outputs=[ASR_RESULT]
|
159 |
)
|
160 |
-
|
|
|
161 |
summarize_button.click(
|
162 |
summarize_text,
|
163 |
-
inputs=[
|
164 |
# inputs=[full_text_output],
|
165 |
outputs=[summary_output]
|
166 |
)
|
|
|
94 |
if summarizer is None:
|
95 |
return "Summarization model could not be loaded."
|
96 |
logger.info("Successfully loaded summarization Model")
|
97 |
+
# full_text = ''.join(item['translated'] for item in results if 'translated' in item)
|
98 |
logger.info(f"\n\nWorking on text:\n{full_text}")
|
99 |
summary = summarizer( full_text, max_length=150, min_length=50, do_sample=False)[0]['summary_text']
|
100 |
return summary
|
|
|
157 |
# outputs=[transcription_output, full_text_output]
|
158 |
outputs=[ASR_RESULT]
|
159 |
)
|
160 |
+
logger.info(f"{ASR_RESULT}")
|
161 |
+
translated_text = ''.join(item['translated'] for item in results if 'translated' in item)
|
162 |
summarize_button.click(
|
163 |
summarize_text,
|
164 |
+
inputs=[translated_text],
|
165 |
# inputs=[full_text_output],
|
166 |
outputs=[summary_output]
|
167 |
)
|