Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
|
2 |
|
3 |
-
# Step 2: Import libraries
|
4 |
import gradio as gr
|
5 |
from transformers import pipeline
|
6 |
|
@@ -18,6 +17,14 @@ def summarize(text, model_name):
|
|
18 |
return summary[0]['summary_text']
|
19 |
|
20 |
# Step 4: Create the Gradio interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
iface = gr.Interface(
|
22 |
fn=summarize,
|
23 |
inputs=[
|
@@ -26,7 +33,7 @@ iface = gr.Interface(
|
|
26 |
],
|
27 |
outputs="textbox",
|
28 |
title="Text Summarizer",
|
29 |
-
description=
|
30 |
)
|
31 |
|
32 |
# Step 5: Launch the interface
|
|
|
1 |
|
2 |
|
|
|
3 |
import gradio as gr
|
4 |
from transformers import pipeline
|
5 |
|
|
|
17 |
return summary[0]['summary_text']
|
18 |
|
19 |
# Step 4: Create the Gradio interface
|
20 |
+
description = """
|
21 |
+
Summarize text using various models from Hugging Face:
|
22 |
+
- BART (facebook/bart-large-cnn)
|
23 |
+
- T5 (t5-small)
|
24 |
+
- Pegasus (google/pegasus-xsum)
|
25 |
+
- DistilBART (sshleifer/distilbart-cnn-12-6)
|
26 |
+
"""
|
27 |
+
|
28 |
iface = gr.Interface(
|
29 |
fn=summarize,
|
30 |
inputs=[
|
|
|
33 |
],
|
34 |
outputs="textbox",
|
35 |
title="Text Summarizer",
|
36 |
+
description=description
|
37 |
)
|
38 |
|
39 |
# Step 5: Launch the interface
|