vikigitonga11 commited on
Commit
6c464c0
Β·
verified Β·
1 Parent(s): d5241d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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 # πŸš€ Allows longer outputs
 
 
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=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",
 
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",