vikigitonga11 commited on
Commit
d136e15
·
verified ·
1 Parent(s): 8cce4ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -18,9 +18,10 @@ def generate_paraphrase(text, temperature):
18
  try:
19
  result = paraphrase_pipeline(
20
  text,
21
- temperature=temperature, # Adds randomness to prevent repetition
22
- top_k=50, # Consider top-k tokens for variation
23
- do_sample=True # Enable sampling
 
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",