Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,6 @@ from transformers import pipeline
|
|
| 5 |
# Initialize Model
|
| 6 |
get_completion = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6", device=0)
|
| 7 |
|
| 8 |
-
|
| 9 |
-
# @spaces.GPU(duration=120)
|
| 10 |
-
# def summarize(input):
|
| 11 |
-
# output = get_completion(input)
|
| 12 |
-
# return output[0]['summary_text']
|
| 13 |
-
|
| 14 |
@spaces.GPU(duration=120)
|
| 15 |
def summarize(input: str) -> str:
|
| 16 |
"""
|
|
@@ -51,7 +45,7 @@ with demo:
|
|
| 51 |
gr.Markdown(title)
|
| 52 |
gr.Markdown(description)
|
| 53 |
interface = gr.Interface(fn=summarize,
|
| 54 |
-
inputs=[gr.Textbox(label="Text to Summarize", lines=
|
| 55 |
-
outputs=[gr.Textbox(label="Result", lines=
|
| 56 |
)
|
| 57 |
demo.launch()
|
|
|
|
| 5 |
# Initialize Model
|
| 6 |
get_completion = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6", device=0)
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
@spaces.GPU(duration=120)
|
| 9 |
def summarize(input: str) -> str:
|
| 10 |
"""
|
|
|
|
| 45 |
gr.Markdown(title)
|
| 46 |
gr.Markdown(description)
|
| 47 |
interface = gr.Interface(fn=summarize,
|
| 48 |
+
inputs=[gr.Textbox(label="Text to Summarize", lines=15)],
|
| 49 |
+
outputs=[gr.Textbox(label="Result", lines=7)]
|
| 50 |
)
|
| 51 |
demo.launch()
|