Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,8 @@
|
|
| 1 |
-
!pip install gradio transformers
|
| 2 |
-
|
| 3 |
from transformers import pipeline
|
| 4 |
-
|
| 5 |
-
model_name = "https://huggingface.co/slauw87/bart_summarisation"
|
| 6 |
-
model = pipeline(task="summarization", model=model_name)
|
| 7 |
-
|
| 8 |
import gradio as gr
|
| 9 |
|
| 10 |
-
|
| 11 |
-
result = model(text)
|
| 12 |
-
return result[0]['label']
|
| 13 |
-
|
| 14 |
-
iface = gr.Interface(fn=classify_text, inputs="text", outputs="text")
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 1 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
pipe = pipeline("summarization", model="slauw87/bart_summarisation")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
demo = gr.Interface.from_pipeline(pipe)
|
| 7 |
+
demo.launch()
|
| 8 |
|