Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,47 +35,11 @@ def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=256
|
|
| 35 |
|
| 36 |
|
| 37 |
additional_inputs=[
|
| 38 |
-
gr.Textbox(
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
)
|
| 43 |
-
gr.Slider(
|
| 44 |
-
label="Temperature",
|
| 45 |
-
value=0.9,
|
| 46 |
-
minimum=0.0,
|
| 47 |
-
maximum=1.0,
|
| 48 |
-
step=0.05,
|
| 49 |
-
interactive=True,
|
| 50 |
-
info="Higher values produce more diverse outputs",
|
| 51 |
-
),
|
| 52 |
-
gr.Slider(
|
| 53 |
-
label="Max new tokens",
|
| 54 |
-
value=256,
|
| 55 |
-
minimum=0,
|
| 56 |
-
maximum=1048,
|
| 57 |
-
step=64,
|
| 58 |
-
interactive=True,
|
| 59 |
-
info="The maximum numbers of new tokens",
|
| 60 |
-
),
|
| 61 |
-
gr.Slider(
|
| 62 |
-
label="Top-p (nucleus sampling)",
|
| 63 |
-
value=0.90,
|
| 64 |
-
minimum=0.0,
|
| 65 |
-
maximum=1,
|
| 66 |
-
step=0.05,
|
| 67 |
-
interactive=True,
|
| 68 |
-
info="Higher values sample more low-probability tokens",
|
| 69 |
-
),
|
| 70 |
-
gr.Slider(
|
| 71 |
-
label="Repetition penalty",
|
| 72 |
-
value=1.2,
|
| 73 |
-
minimum=1.0,
|
| 74 |
-
maximum=2.0,
|
| 75 |
-
step=0.05,
|
| 76 |
-
interactive=True,
|
| 77 |
-
info="Penalize repeated tokens",
|
| 78 |
-
)
|
| 79 |
]
|
| 80 |
|
| 81 |
examples=[['Give me the grammatically correct version of the sentence: "We shood buy an car"', None, None, None, None, None, ],
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
additional_inputs=[
|
| 38 |
+
gr.Textbox( label="System Prompt", max_lines=1, interactive=True, ),
|
| 39 |
+
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", ),
|
| 40 |
+
gr.Slider( label="Max new tokens", value=256, minimum=0, maximum=1048, step=64, interactive=True, info="The maximum numbers of new tokens", ),
|
| 41 |
+
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", ),
|
| 42 |
+
gr.Slider( label="Repetition penalty", value=1.2, minimum=1.0, maximum=2.0, step=0.05, interactive=True, info="Penalize repeated tokens", )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
]
|
| 44 |
|
| 45 |
examples=[['Give me the grammatically correct version of the sentence: "We shood buy an car"', None, None, None, None, None, ],
|