Tawkat commited on
Commit
a985da4
1 Parent(s): f7dfe8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -15,7 +15,7 @@ def format_prompt(message, history):
15
  return prompt
16
 
17
  def generate(
18
- prompt, history, temperature=0.9, max_length=2000, top_p=0.95, repetition_penalty=1.0,
19
  ):
20
  temperature = float(temperature)
21
  if temperature < 1e-2:
@@ -24,7 +24,7 @@ def generate(
24
 
25
  generate_kwargs = dict(
26
  temperature=temperature,
27
- max_length=max_length,
28
  top_p=top_p,
29
  repetition_penalty=repetition_penalty,
30
  do_sample=True,
@@ -53,13 +53,13 @@ additional_inputs=[
53
  info="Higher values produce more diverse outputs",
54
  ),
55
  gr.Slider(
56
- label="Maximum Length",
57
- value=2000,
58
  minimum=0,
59
  maximum=1048,
60
  step=64,
61
  interactive=True,
62
- info="The maximum numbers of total tokens",
63
  ),
64
  gr.Slider(
65
  label="Top-p (nucleus sampling)",
 
15
  return prompt
16
 
17
  def generate(
18
+ prompt, history, temperature=0.9, max_new_tokens=1000, top_p=0.95, repetition_penalty=1.0,
19
  ):
20
  temperature = float(temperature)
21
  if temperature < 1e-2:
 
24
 
25
  generate_kwargs = dict(
26
  temperature=temperature,
27
+ max_new_tokens=max_new_tokens,
28
  top_p=top_p,
29
  repetition_penalty=repetition_penalty,
30
  do_sample=True,
 
53
  info="Higher values produce more diverse outputs",
54
  ),
55
  gr.Slider(
56
+ label="Max new tokens",
57
+ value=1000,
58
  minimum=0,
59
  maximum=1048,
60
  step=64,
61
  interactive=True,
62
+ info="The maximum numbers of new tokens",
63
  ),
64
  gr.Slider(
65
  label="Top-p (nucleus sampling)",