Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,23 +45,20 @@ summarization_pipe = pipeline("summarization", model="facebook/bart-large-cnn")
|
|
| 45 |
def summarize_text(text):
|
| 46 |
summary = summarization_pipe(text, max_length=100, min_length=50, do_sample=False)[0]['summary_text']
|
| 47 |
return summary
|
| 48 |
-
with gr.Blocks(fill_height=True, css=css) as demo:
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
# Create the chat interface
|
| 53 |
-
chatbot = gr.Interface(
|
| 54 |
summarize_text,
|
| 55 |
gr.Textbox(lines=5, label="Input Text"),
|
| 56 |
gr.Textbox(label="Summary"),
|
| 57 |
#title="Text Summarization Chatbot",
|
| 58 |
-
|
| 59 |
#theme="compact"
|
| 60 |
-
theme="
|
| 61 |
)
|
| 62 |
|
| 63 |
-
gr.Markdown(LICENSE)
|
| 64 |
|
| 65 |
# Launch the chat interface
|
| 66 |
if __name__ == "__main__":
|
| 67 |
chatbot.launch()
|
|
|
|
|
|
| 45 |
def summarize_text(text):
|
| 46 |
summary = summarization_pipe(text, max_length=100, min_length=50, do_sample=False)[0]['summary_text']
|
| 47 |
return summary
|
|
|
|
| 48 |
|
| 49 |
+
# Create the chat interface
|
| 50 |
+
chatbot = gr.Interface(
|
|
|
|
|
|
|
| 51 |
summarize_text,
|
| 52 |
gr.Textbox(lines=5, label="Input Text"),
|
| 53 |
gr.Textbox(label="Summary"),
|
| 54 |
#title="Text Summarization Chatbot",
|
| 55 |
+
description=DESCRIPTION,
|
| 56 |
#theme="compact"
|
| 57 |
+
theme="css"
|
| 58 |
)
|
| 59 |
|
|
|
|
| 60 |
|
| 61 |
# Launch the chat interface
|
| 62 |
if __name__ == "__main__":
|
| 63 |
chatbot.launch()
|
| 64 |
+
|