*    human-like model
*   kivy 2
*  uv
* window location fix
* macosx package no thanks to jules who is a derp, but cloud is hapl and fix.
* settings gui a bit clearer
* better ci i hope


---------

Co-authored-by: TuNanTang <tunantang@aliyun.com>
Co-authored-by: jtkelm2 <feryllcuber@gmail.com>
This commit is contained in:
authored and GitHub committed 2025-06-11 14:37:24 +02:00
1 parent c8d5f8af88
commit 6fc47abb35
44 files changed
+2992 -1698

No files matched your search

+184 -114
View File
@@ -1,4 +1,4 @@
#:kivy 1.11.0
#:kivy 2.3.0
#:import i18n katrain.core.lang.i18n
#:import expanduser os.path.expanduser
#:import abspath os.path.abspath
@@ -78,189 +78,259 @@
<SmallDescriptionLabel@DescriptionLabel>
font_size: sp(Theme.DESC_FONT_SIZE) * 0.66
<ConfigSectionGridLayout@MDGridLayout+BackgroundMixin>:
padding: CP_PADDING/2
spacing: CP_SMALL_SPACING
background_color: Theme.BOX_BACKGROUND_COLOR
<ConfigPopup>:
model_path: model_path
humanlike_model_path: humanlike_model_path
katago_path: katago_path
model_files: model_files
humanlike_model_files: humanlike_model_files
katago_files: katago_files
download_progress_box: download_progress_box
katago_download_progress_box: katago_download_progress_box
DescriptionLabel:
text: i18n._('katago settings')
font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
GridLayout:
cols: 2
rows: 6
size_hint: 1,6
spacing: CP_SPACING
DescriptionLabel:
text: i18n._("engine:katago")
size_hint: 0.33, 1
AnchorLayout:
LabelledPathInput:
id: katago_path
input_property: "engine/katago"
hint_text: i18n._("engine:katago:hint")
on_text: root.check_katas()
AnchorLayout:
size_hint: 0.33, 1
AutoSizedRoundedRectangleButton:
text: i18n._("download katago button")
on_press: root.download_katas()
size_hint_y: 0.7
AnchorLayout:
KeyValueSpinner:
id: katago_files
text: ''
text_autoupdate: True
-text_size: self.width, None
-halign: 'center'
-shorten: True
-shorten_from: 'right'
on_select:
if self.selected_index != 0: katago_path.text = self.value_keys[self.selected_index]
size_hint_y: 0.7
sync_height_frac: 1.0
-font_size: self.height * 0.5
-background_color: [*[c*255/88 for c in Theme.BOX_BACKGROUND_COLOR[:3]], 1] # compensate for texture
DescriptionLabel:
text: i18n._("engine:config")
size_hint: 0.33, 1
AnchorLayout:
LabelledPathInput:
input_property: "engine/config"
DescriptionLabel:
text: i18n._("engine:model")
size_hint: 0.33, 1
AnchorLayout:
LabelledPathInput:
id: model_path
input_property: "engine/model"
on_text: root.check_models()
AnchorLayout:
size_hint: 0.33, 1
AutoSizedRoundedRectangleButton:
text: i18n._("download models button")
on_press: root.download_models()
size_hint_y: 0.7
AnchorLayout:
KeyValueSpinner:
id: model_files
text: ''
text_autoupdate: True
-text_size: self.width, None
-halign: 'center'
-shorten: True
-shorten_from: 'right'
on_select:
if self.selected_index != 0: model_path.text = self.value_keys[self.selected_index]
size_hint_y: 0.7
sync_height_frac: 1.0
-font_size: self.height * 0.5
-background_color: [*[c*255/88 for c in Theme.BOX_BACKGROUND_COLOR[:3]], 1] # compensate for texture
DescriptionLabel:
text: i18n._("engine:altcommand")
size_hint: 0.33, 1
AnchorLayout:
LabelledPathInput:
check_path: False
input_property: "engine/altcommand"
hint_text: i18n._("engine:altcommand:hint")
# Top Section - KataGo Controls
BoxLayout:
size_hint: 1,1
orientation: 'horizontal'
size_hint_y: None
height: dp(50)
spacing: dp(20)
padding: dp(10)
DescriptionLabel:
text: i18n._('katago settings')
font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
size_hint_x: 0.4
AutoSizedRoundedRectangleButton:
text: i18n._("download katago button")
on_press: root.download_katas()
size_hint: (0.3, 0.8)
AutoSizedRoundedRectangleButton:
text: i18n._("download models button")
on_press: root.download_models()
size_hint: (0.3, 0.8)
# Main Content Area
MDBoxLayout:
orientation: 'vertical'
size_hint: (1, 6)
spacing: dp(15)
padding: dp(10)
# Model Section
ConfigSectionGridLayout:
cols: 2
DescriptionLabel:
text: i18n._("engine:model")
size_hint: (0.33, 1)
AnchorLayout:
LabelledPathInput:
id: model_path
input_property: "engine/model"
on_text: root.check_models()
Label:
size_hint: (0.33, 1)
AnchorLayout:
KeyValueSpinner:
id: model_files
text: ''
text_autoupdate: True
size_hint_y: 0.7
on_select: if self.selected_index != 0: model_path.text = self.value_keys[self.selected_index]
# Humanlike Model Section
ConfigSectionGridLayout:
cols: 2
DescriptionLabel:
text: i18n._("engine:humanlike_model")
size_hint: (0.33, 1)
AnchorLayout:
LabelledPathInput:
id: humanlike_model_path
input_property: "engine/humanlike_model"
on_text: root.check_models()
Label:
size_hint: (0.33, 1)
AnchorLayout:
KeyValueSpinner:
id: humanlike_model_files
text: ''
text_autoupdate: True
size_hint_y: 0.7
on_select: if self.selected_index != 0: humanlike_model_path.text = self.value_keys[self.selected_index]
# KataGo Engine Section
ConfigSectionGridLayout:
cols: 2
DescriptionLabel:
text: i18n._("engine:katago")
size_hint: (0.33, 1)
AnchorLayout:
LabelledPathInput:
id: katago_path
input_property: "engine/katago"
hint_text: i18n._("engine:katago:hint")
on_text: root.check_katas()
Label:
size_hint: (0.33, 1)
AnchorLayout:
KeyValueSpinner:
id: katago_files
text: ''
text_autoupdate: True
size_hint_y: 0.7
on_select: if self.selected_index != 0: katago_path.text = self.value_keys[self.selected_index]
ConfigSectionGridLayout:
rows: 2
cols: 2
DescriptionLabel:
text: i18n._("engine:config")
size_hint: 0.33, 1
AnchorLayout:
LabelledPathInput:
input_property: "engine/config"
DescriptionLabel:
text: i18n._("engine:altcommand")
size_hint: 0.33, 1
AnchorLayout:
LabelledPathInput:
check_path: False
input_property: "engine/altcommand"
hint_text: i18n._("engine:altcommand:hint")
# Settings Headers
MDBoxLayout:
size_hint_y: 0.5
orientation: 'horizontal'
padding: dp(10)
spacing: dp(20)
DescriptionLabel:
text: i18n._('general settings')
font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
DescriptionLabel:
font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
text: i18n._('engine settings')
BoxLayout:
size_hint: 1,5
font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
# Settings Area
MDBoxLayout:
size_hint: (1, 4)
orientation: 'horizontal'
GridLayout:
padding: dp(10)
spacing: dp(20)
# General Settings
ConfigSectionGridLayout:
cols: 2
rows: 4
spacing: CP_SPACING
padding: CP_PADDING
DescriptionLabel:
text: i18n._('count down sound')
size_hint_x: 1.5
AnchorLayout:
LabelledCheckBox:
input_property: "timer/sound"
DescriptionLabel:
text: i18n._("general:anim_pv_time")
size_hint_x: 1.5
AnchorLayout:
LabelledFloatInput:
input_property: "general/anim_pv_time"
hint_text: i18n._("engine:time:hint")
DescriptionLabel:
text: 'Restore window size on startup'
size_hint_x: 1.5
AnchorLayout:
LabelledCheckBox:
input_property: "ui_state/restoresize"
DescriptionLabel:
text: i18n._("general:debug_level")
size_hint_x: 1.5
AnchorLayout:
LabelledIntInput:
input_property: "general/debug_level"
helper_text: i18n._("general:debug_level:hint")
helper_text_mode: "on_focus"
DescriptionLabel:
text: 'Restore window size on startup'
AnchorLayout:
LabelledCheckBox:
input_property: "ui_state/restoresize"
BackgroundMixin:
background_color: LIGHT_GREY
size_hint: None, 1
width: 2
GridLayout:
# Engine Settings
ConfigSectionGridLayout:
cols: 2
rows: 4
spacing: CP_SPACING
padding: CP_PADDING*2,0,0,0
DescriptionLabel:
text: i18n._("engine:max_visits")
size_hint_x: 1.5
AnchorLayout:
LabelledIntInput:
input_property: "engine/max_visits"
DescriptionLabel:
text: i18n._("engine:fast_visits")
size_hint_x: 1.5
AnchorLayout:
LabelledIntInput:
input_property: "engine/fast_visits"
DescriptionLabel:
text: i18n._("engine:max_time")
size_hint_x: 1.5
AnchorLayout:
LabelledFloatInput:
input_property: "engine/max_time"
hint_text: i18n._("engine:time:hint")
DescriptionLabel:
text: i18n._("engine:wide_root_noise")
size_hint_x: 1.5
AnchorLayout:
LabelledFloatInput:
input_property: "engine/wide_root_noise"
hint_text: i18n._("engine:wide_root_noise:hint")
# Bottom Section - Progress and Update Button
MDBoxLayout:
orientation: 'horizontal'
size_hint: 1,2
size_hint_y: 1
MDBoxLayout:
size_hint_x: 3.5 if self.children else 0.0001
size_hint_x: 3 if self.children else 0.0001
orientation: 'vertical'
id: download_progress_box
MDBoxLayout:
size_hint_x: 3.5 if self.children else 0.0001
size_hint_x: 3 if self.children else 0.0001
orientation: 'vertical'
id: katago_download_progress_box
AnchorLayout:
AutoSizedRoundedRectangleButton:
padding_x: 15
size_hint: None,None
height: sp(40)
text: i18n._("update settings")
size_hint: (None, None)
height: dp(40)
padding_x: dp(15)
on_press: root.update_config(True)
# BoxLayout:
# orientation: 'vertical'
# SmallDescriptionLabel:
# text: i18n._('config file path')
# SmallDescriptionLabel:
# id: configfile
# text:
<ContributePopup>:
katago_path: katago_path