Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import BartTokenizer, BartForConditionalGeneration
|
| 3 |
|
| 4 |
-
model_name = "facebook/bart-large-cnn" # Example BART model
|
| 5 |
tokenizer = BartTokenizer.from_pretrained(model_name)
|
| 6 |
model = BartForConditionalGeneration.from_pretrained(model_name)
|
| 7 |
|
|
@@ -11,7 +11,7 @@ def generate_text(prompt):
|
|
| 11 |
return tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 12 |
|
| 13 |
interface = gr.Interface(fn=generate_text,
|
| 14 |
-
inputs=gr.
|
| 15 |
outputs="text",
|
| 16 |
title="Text Generation with BART",
|
| 17 |
description="Enter text to generate a summary.")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import BartTokenizer, BartForConditionalGeneration
|
| 3 |
|
| 4 |
+
model_name = "facebook/bart-large-cnn" # Example BART model for demonstration
|
| 5 |
tokenizer = BartTokenizer.from_pretrained(model_name)
|
| 6 |
model = BartForConditionalGeneration.from_pretrained(model_name)
|
| 7 |
|
|
|
|
| 11 |
return tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 12 |
|
| 13 |
interface = gr.Interface(fn=generate_text,
|
| 14 |
+
inputs=gr.Textbox(lines=5, placeholder="Enter Text Here..."),
|
| 15 |
outputs="text",
|
| 16 |
title="Text Generation with BART",
|
| 17 |
description="Enter text to generate a summary.")
|