Update app.py
Browse files
app.py
CHANGED
@@ -18,9 +18,10 @@ def generate_paraphrase(text, temperature):
|
|
18 |
try:
|
19 |
result = paraphrase_pipeline(
|
20 |
text,
|
21 |
-
temperature=temperature,
|
22 |
-
top_k=50,
|
23 |
-
do_sample=True
|
|
|
24 |
)
|
25 |
|
26 |
# Ensure correct output formatting
|
@@ -43,7 +44,7 @@ demo = gr.Interface(
|
|
43 |
gr.Textbox(label="Enter text", placeholder="Type your text to paraphrase...", lines=5),
|
44 |
gr.Slider(0.5, 1.5, value=1.0, step=0.1, label="Creativity (Temperature)"),
|
45 |
],
|
46 |
-
outputs=gr.Textbox(label="Paraphrased Text"),
|
47 |
title="📝 AI Paraphraser",
|
48 |
description=description,
|
49 |
theme="huggingface",
|
|
|
18 |
try:
|
19 |
result = paraphrase_pipeline(
|
20 |
text,
|
21 |
+
temperature=temperature,
|
22 |
+
top_k=50,
|
23 |
+
do_sample=True,
|
24 |
+
max_new_tokens=500 # 🚀 Allows longer outputs
|
25 |
)
|
26 |
|
27 |
# Ensure correct output formatting
|
|
|
44 |
gr.Textbox(label="Enter text", placeholder="Type your text to paraphrase...", lines=5),
|
45 |
gr.Slider(0.5, 1.5, value=1.0, step=0.1, label="Creativity (Temperature)"),
|
46 |
],
|
47 |
+
outputs=gr.Textbox(label="Paraphrased Text", lines=10), # 📝 More space for longer output
|
48 |
title="📝 AI Paraphraser",
|
49 |
description=description,
|
50 |
theme="huggingface",
|