feat(ui): AI Settings Overhaul - added dual sliders for model params including top_p
This commit is contained in:
40
src/gui_2.py
40
src/gui_2.py
@@ -78,6 +78,7 @@ class GenerateRequest(BaseModel):
|
||||
prompt: str
|
||||
auto_add_history: bool = True
|
||||
temperature: float | None = None
|
||||
top_p: float | None = None
|
||||
max_tokens: int | None = None
|
||||
|
||||
class ConfirmRequest(BaseModel):
|
||||
@@ -108,6 +109,7 @@ class App:
|
||||
self._editing_persona_model = ""
|
||||
self._editing_persona_system_prompt = ""
|
||||
self._editing_persona_temperature = 0.7
|
||||
self._editing_persona_top_p = 1.0
|
||||
self._editing_persona_max_tokens = 4096
|
||||
self._editing_persona_tool_preset_id = ""
|
||||
self._editing_persona_bias_profile_id = ""
|
||||
@@ -1345,7 +1347,14 @@ class App:
|
||||
self._persona_pref_models_expanded[i] = not is_expanded
|
||||
imgui.same_line()
|
||||
|
||||
imgui.text(f"{i+1}. {prov} - {mod}")
|
||||
imgui.text(f"{i+1}.")
|
||||
imgui.same_line()
|
||||
imgui.text_colored(C_LBL, f"{prov}")
|
||||
imgui.same_line()
|
||||
imgui.text("-")
|
||||
imgui.same_line()
|
||||
imgui.text_colored(C_IN, f"{mod}")
|
||||
|
||||
imgui.same_line(imgui.get_content_region_avail().x - 30)
|
||||
if imgui.button("x"):
|
||||
to_remove.append(i)
|
||||
@@ -2366,8 +2375,33 @@ def hello():
|
||||
imgui.end_list_box()
|
||||
imgui.separator()
|
||||
imgui.text("Parameters")
|
||||
ch, self.temperature = imgui.slider_float("Temperature", self.temperature, 0.0, 2.0, "%.2f")
|
||||
ch, self.max_tokens = imgui.input_int("Max Tokens (Output)", self.max_tokens, 1024)
|
||||
# Temperature
|
||||
imgui.push_id("temp")
|
||||
imgui.set_next_item_width(imgui.get_content_region_avail().x * 0.6)
|
||||
_, self.temperature = imgui.slider_float("##slider", self.temperature, 0.0, 2.0, "%.2f")
|
||||
imgui.same_line()
|
||||
imgui.set_next_item_width(-1)
|
||||
_, self.temperature = imgui.input_float("Temp", self.temperature, 0.0, 0.0, "%.2f")
|
||||
imgui.pop_id()
|
||||
|
||||
# Top-P
|
||||
imgui.push_id("top_p")
|
||||
imgui.set_next_item_width(imgui.get_content_region_avail().x * 0.6)
|
||||
_, self.top_p = imgui.slider_float("##slider", self.top_p, 0.0, 1.0, "%.2f")
|
||||
imgui.same_line()
|
||||
imgui.set_next_item_width(-1)
|
||||
_, self.top_p = imgui.input_float("Top-P", self.top_p, 0.0, 0.0, "%.2f")
|
||||
imgui.pop_id()
|
||||
|
||||
# Max Tokens
|
||||
imgui.push_id("max_tokens")
|
||||
imgui.set_next_item_width(imgui.get_content_region_avail().x * 0.6)
|
||||
_, self.max_tokens = imgui.slider_int("##slider", self.max_tokens, 1, 32768)
|
||||
imgui.same_line()
|
||||
imgui.set_next_item_width(-1)
|
||||
_, self.max_tokens = imgui.input_int("MaxTok", self.max_tokens)
|
||||
imgui.pop_id()
|
||||
|
||||
ch, self.history_trunc_limit = imgui.input_int("History Truncation Limit", self.history_trunc_limit, 1024)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user