Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,9 @@ def generate_paraphrase(text, temperature):
|
|
21 |
temperature=temperature,
|
22 |
top_k=50,
|
23 |
do_sample=True,
|
24 |
-
max_new_tokens=1000 # π
|
|
|
|
|
25 |
)
|
26 |
|
27 |
# Ensure correct output formatting
|
@@ -36,15 +38,16 @@ description = """
|
|
36 |
Enter text and let AI generate a paraphrased version!
|
37 |
- **Creativity (Temperature)** controls how varied the output is.
|
38 |
- **Input is limited to 700 words.**
|
|
|
39 |
"""
|
40 |
|
41 |
demo = gr.Interface(
|
42 |
fn=generate_paraphrase,
|
43 |
inputs=[
|
44 |
-
gr.Textbox(label="Enter text", placeholder="Type your text to paraphrase...", lines=
|
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=
|
48 |
title="π AI Paraphraser",
|
49 |
description=description,
|
50 |
theme="huggingface",
|
|
|
21 |
temperature=temperature,
|
22 |
top_k=50,
|
23 |
do_sample=True,
|
24 |
+
max_new_tokens=1000, # π Extended output length
|
25 |
+
repetition_penalty=1.2, # π Reduces repetition
|
26 |
+
early_stopping=False # β Prevents early cutoff
|
27 |
)
|
28 |
|
29 |
# Ensure correct output formatting
|
|
|
38 |
Enter text and let AI generate a paraphrased version!
|
39 |
- **Creativity (Temperature)** controls how varied the output is.
|
40 |
- **Input is limited to 700 words.**
|
41 |
+
- **Now supports longer paraphrased outputs!**
|
42 |
"""
|
43 |
|
44 |
demo = gr.Interface(
|
45 |
fn=generate_paraphrase,
|
46 |
inputs=[
|
47 |
+
gr.Textbox(label="Enter text", placeholder="Type your text to paraphrase...", lines=7), # Bigger input box
|
48 |
gr.Slider(0.5, 1.5, value=1.0, step=0.1, label="Creativity (Temperature)"),
|
49 |
],
|
50 |
+
outputs=gr.Textbox(label="Paraphrased Text", lines=15), # π₯ Expands output display
|
51 |
title="π AI Paraphraser",
|
52 |
description=description,
|
53 |
theme="huggingface",
|