Update app.py
Browse files
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,
|
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 |
-
|
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="
|
57 |
-
value=
|
58 |
minimum=0,
|
59 |
maximum=1048,
|
60 |
step=64,
|
61 |
interactive=True,
|
62 |
-
info="The maximum numbers of
|
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)",
|