Spaces:
Paused
Paused
remove extras
Browse files
app.py
CHANGED
@@ -31,10 +31,10 @@ def generate(
|
|
31 |
message: str,
|
32 |
chat_history: list[tuple[str, str]],
|
33 |
max_new_tokens: int = 1024,
|
34 |
-
temperature: float = 0.6,
|
35 |
-
top_p: float = 0.9,
|
36 |
-
top_k: int = 50,
|
37 |
-
repetition_penalty: float = 1.2,
|
38 |
) -> Iterator[str]:
|
39 |
conversation = []
|
40 |
current_input = ""
|
@@ -57,12 +57,12 @@ def generate(
|
|
57 |
{"input_ids": input_ids},
|
58 |
streamer=streamer,
|
59 |
max_new_tokens=max_new_tokens,
|
60 |
-
do_sample=True,
|
61 |
-
top_p=top_p,
|
62 |
-
top_k=top_k,
|
63 |
-
temperature=temperature,
|
64 |
-
num_beams=1,
|
65 |
-
repetition_penalty=repetition_penalty,
|
66 |
)
|
67 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
68 |
t.start()
|
@@ -83,34 +83,34 @@ chat_interface = gr.ChatInterface(
|
|
83 |
step=1,
|
84 |
value=DEFAULT_MAX_NEW_TOKENS,
|
85 |
),
|
86 |
-
gr.Slider(
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
),
|
93 |
-
gr.Slider(
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
),
|
100 |
-
gr.Slider(
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
),
|
107 |
-
gr.Slider(
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
),
|
114 |
],
|
115 |
stop_btn=None,
|
116 |
examples=[
|
|
|
31 |
message: str,
|
32 |
chat_history: list[tuple[str, str]],
|
33 |
max_new_tokens: int = 1024,
|
34 |
+
#temperature: float = 0.6,
|
35 |
+
#top_p: float = 0.9,
|
36 |
+
#top_k: int = 50,
|
37 |
+
#repetition_penalty: float = 1.2,
|
38 |
) -> Iterator[str]:
|
39 |
conversation = []
|
40 |
current_input = ""
|
|
|
57 |
{"input_ids": input_ids},
|
58 |
streamer=streamer,
|
59 |
max_new_tokens=max_new_tokens,
|
60 |
+
#do_sample=True,
|
61 |
+
#top_p=top_p,
|
62 |
+
#top_k=top_k,
|
63 |
+
#temperature=temperature,
|
64 |
+
#num_beams=1,
|
65 |
+
#repetition_penalty=repetition_penalty,
|
66 |
)
|
67 |
t = Thread(target=model.generate, kwargs=generate_kwargs)
|
68 |
t.start()
|
|
|
83 |
step=1,
|
84 |
value=DEFAULT_MAX_NEW_TOKENS,
|
85 |
),
|
86 |
+
# gr.Slider(
|
87 |
+
# label="Temperature",
|
88 |
+
# minimum=0.1,
|
89 |
+
# maximum=4.0,
|
90 |
+
# step=0.1,
|
91 |
+
# value=0.6,
|
92 |
+
# ),
|
93 |
+
# gr.Slider(
|
94 |
+
# label="Top-p (nucleus sampling)",
|
95 |
+
# minimum=0.05,
|
96 |
+
# maximum=1.0,
|
97 |
+
# step=0.05,
|
98 |
+
# value=0.9,
|
99 |
+
# ),
|
100 |
+
# gr.Slider(
|
101 |
+
# label="Top-k",
|
102 |
+
# minimum=1,
|
103 |
+
# maximum=1000,
|
104 |
+
# step=1,
|
105 |
+
# value=50,
|
106 |
+
# ),
|
107 |
+
# gr.Slider(
|
108 |
+
# label="Repetition penalty",
|
109 |
+
# minimum=1.0,
|
110 |
+
# maximum=2.0,
|
111 |
+
# step=0.05,
|
112 |
+
# value=1.2,
|
113 |
+
# ),
|
114 |
],
|
115 |
stop_btn=None,
|
116 |
examples=[
|