Spaces:
Runtime error
Runtime error
vericudebuget
commited on
Commit
•
7d03deb
1
Parent(s):
b3497d8
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def format_prompt(message, history):
|
|
14 |
prompt += f"[INST] {message} [/INST]"
|
15 |
return prompt
|
16 |
|
17 |
-
def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=
|
18 |
temperature = max(float(temperature), 1e-2)
|
19 |
top_p = float(top_p)
|
20 |
|
@@ -39,7 +39,7 @@ def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=320
|
|
39 |
additional_inputs = [
|
40 |
gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
|
41 |
gr.Slider(label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs"),
|
42 |
-
gr.Slider(label="Max new tokens", value=
|
43 |
gr.Slider(label="Top-p (nucleus sampling)", value=0.90, minimum=0.0, maximum=1, step=0.05, interactive=True, info="Higher values sample more low-probability tokens"),
|
44 |
gr.Slider(label="Repetition penalty", value=1.2, minimum=1.0, maximum=2.0, step=0.05, interactive=True, info="Penalize repeated tokens")
|
45 |
]
|
|
|
14 |
prompt += f"[INST] {message} [/INST]"
|
15 |
return prompt
|
16 |
|
17 |
+
def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0):
|
18 |
temperature = max(float(temperature), 1e-2)
|
19 |
top_p = float(top_p)
|
20 |
|
|
|
39 |
additional_inputs = [
|
40 |
gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
|
41 |
gr.Slider(label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs"),
|
42 |
+
gr.Slider(label="Max new tokens", value=9048, minimum=256, maximum=9048, step=64, interactive=True, info="The maximum numbers of new tokens"),
|
43 |
gr.Slider(label="Top-p (nucleus sampling)", value=0.90, minimum=0.0, maximum=1, step=0.05, interactive=True, info="Higher values sample more low-probability tokens"),
|
44 |
gr.Slider(label="Repetition penalty", value=1.2, minimum=1.0, maximum=2.0, step=0.05, interactive=True, info="Penalize repeated tokens")
|
45 |
]
|