Spaces:
Runtime error
Runtime error
Mai Chí Bảo
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,16 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
-
# I add cmt
|
4 |
|
5 |
-
# Initialize the summarization model
|
6 |
-
model = pipeline("summarization")
|
7 |
|
|
|
|
|
|
|
8 |
|
9 |
def predict(prompt):
|
10 |
summary = model(prompt)[0]["summary_text"]
|
11 |
return summary
|
12 |
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
# Launch the interface
|
19 |
-
interface.launch()
|
20 |
-
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
|
|
3 |
|
|
|
|
|
4 |
|
5 |
+
model = pipeline(
|
6 |
+
"summarization",
|
7 |
+
)
|
8 |
|
9 |
def predict(prompt):
|
10 |
summary = model(prompt)[0]["summary_text"]
|
11 |
return summary
|
12 |
|
13 |
|
14 |
+
# create an interface for the model
|
15 |
+
with gr.Interface(predict, "textbox", "text") as interface:
|
16 |
+
interface.launch()
|
|
|
|
|
|
|
|