Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
|
| 4 |
MODEL_ID = 'lityops/Style-Summarizer'
|
| 5 |
|
| 6 |
-
|
| 7 |
-
summarizer = pipeline(
|
| 8 |
-
"summarization",
|
| 9 |
-
model=MODEL_ID,
|
| 10 |
-
tokenizer=tokenizer,
|
| 11 |
-
device=-1
|
| 12 |
-
)
|
| 13 |
|
| 14 |
def generate_summary(text, style):
|
| 15 |
if not text or len(text.strip()) < 50:
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
MODEL_ID = 'lityops/Style-Summarizer'
|
| 5 |
|
| 6 |
+
summarizer = pipeline("summarization", model=MODEL_ID)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def generate_summary(text, style):
|
| 9 |
if not text or len(text.strip()) < 50:
|