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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -18,10 +18,9 @@ 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
- max_new_tokens=500 # 🚀 Allows longer outputs
25
  )
26
 
27
  # Ensure correct output formatting
@@ -44,7 +43,7 @@ demo = gr.Interface(
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",
 
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
  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",