Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,11 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Define a function that takes a text and returns a summary
|
| 9 |
def summarize(text):
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
+
# Import a specific model
|
| 6 |
+
model_name = "facebook/bart-large-cnn"
|
| 7 |
+
|
| 8 |
+
# Create a summarization pipeline with Facebook Bart
|
| 9 |
+
summarizer = pipeline("summarization", model=model_name)
|
| 10 |
|
| 11 |
# Define a function that takes a text and returns a summary
|
| 12 |
def summarize(text):
|