Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,8 @@ def generate(
|
|
37 |
message: str,
|
38 |
chat_history: list[dict],
|
39 |
max_new_tokens: int = 1024,
|
40 |
-
|
|
|
41 |
top_p: float = 0.9,
|
42 |
top_k: int = 50,
|
43 |
repetition_penalty: float = 1.2,
|
@@ -56,7 +57,7 @@ def generate(
|
|
56 |
{"input_ids": input_ids},
|
57 |
streamer=streamer,
|
58 |
max_new_tokens=max_new_tokens,
|
59 |
-
do_sample=
|
60 |
top_p=top_p,
|
61 |
top_k=top_k,
|
62 |
temperature=temperature,
|
@@ -82,6 +83,7 @@ chat_interface = gr.ChatInterface(
|
|
82 |
step=1,
|
83 |
value=DEFAULT_MAX_NEW_TOKENS,
|
84 |
),
|
|
|
85 |
gr.Slider(
|
86 |
label="Temperature",
|
87 |
minimum=0.0,
|
|
|
37 |
message: str,
|
38 |
chat_history: list[dict],
|
39 |
max_new_tokens: int = 1024,
|
40 |
+
do_sample: bool = False,
|
41 |
+
temperature: float = 0.6,
|
42 |
top_p: float = 0.9,
|
43 |
top_k: int = 50,
|
44 |
repetition_penalty: float = 1.2,
|
|
|
57 |
{"input_ids": input_ids},
|
58 |
streamer=streamer,
|
59 |
max_new_tokens=max_new_tokens,
|
60 |
+
do_sample=do_sample,
|
61 |
top_p=top_p,
|
62 |
top_k=top_k,
|
63 |
temperature=temperature,
|
|
|
83 |
step=1,
|
84 |
value=DEFAULT_MAX_NEW_TOKENS,
|
85 |
),
|
86 |
+
gr.Checkbox(label="Do Sample"),
|
87 |
gr.Slider(
|
88 |
label="Temperature",
|
89 |
minimum=0.0,
|