Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
1cb7a61
1
Parent(s):
de12b06
修护temperature滑动条和top_p滑动条
Browse files- ChuanhuChatbot.py +4 -2
- modules/base_model.py +2 -2
ChuanhuChatbot.py
CHANGED
@@ -160,7 +160,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
160 |
default_btn = gr.Button("🔙 恢复默认设置")
|
161 |
|
162 |
with gr.Accordion("参数", open=False):
|
163 |
-
|
164 |
minimum=-0,
|
165 |
maximum=1.0,
|
166 |
value=1.0,
|
@@ -168,7 +168,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
168 |
interactive=True,
|
169 |
label="Top-p",
|
170 |
)
|
171 |
-
|
172 |
minimum=-0,
|
173 |
maximum=2.0,
|
174 |
value=1.0,
|
@@ -326,6 +326,8 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
326 |
downloadFile.change(**load_history_from_file_args)
|
327 |
|
328 |
# Advanced
|
|
|
|
|
329 |
default_btn.click(
|
330 |
reset_default, [], [apihostTxt, proxyTxt, status_display], show_progress=True
|
331 |
)
|
|
|
160 |
default_btn = gr.Button("🔙 恢复默认设置")
|
161 |
|
162 |
with gr.Accordion("参数", open=False):
|
163 |
+
top_p_slider = gr.Slider(
|
164 |
minimum=-0,
|
165 |
maximum=1.0,
|
166 |
value=1.0,
|
|
|
168 |
interactive=True,
|
169 |
label="Top-p",
|
170 |
)
|
171 |
+
temperature_slider = gr.Slider(
|
172 |
minimum=-0,
|
173 |
maximum=2.0,
|
174 |
value=1.0,
|
|
|
326 |
downloadFile.change(**load_history_from_file_args)
|
327 |
|
328 |
# Advanced
|
329 |
+
top_p_slider.change(current_model.value.set_top_p, [top_p_slider], None)
|
330 |
+
temperature_slider.change(current_model.value.set_temperature, [temperature_slider], None)
|
331 |
default_btn.click(
|
332 |
reset_default, [], [apihostTxt, proxyTxt, status_display], show_progress=True
|
333 |
)
|
modules/base_model.py
CHANGED
@@ -340,8 +340,8 @@ class BaseLLMModel:
|
|
340 |
def recover(self):
|
341 |
self.interrupted = False
|
342 |
|
343 |
-
def
|
344 |
-
self.temperature =
|
345 |
|
346 |
def set_top_p(self, new_top_p):
|
347 |
self.top_p = new_top_p
|
|
|
340 |
def recover(self):
|
341 |
self.interrupted = False
|
342 |
|
343 |
+
def set_temperature(self, new_temperature):
|
344 |
+
self.temperature = new_temperature
|
345 |
|
346 |
def set_top_p(self, new_top_p):
|
347 |
self.top_p = new_top_p
|