@@ -764,6 +764,10 @@ def getfilename(var, text):
764
764
765
765
context_var = ctk .IntVar ()
766
766
767
+ customrope_var = ctk .IntVar ()
768
+ customrope_scale = ctk .StringVar (value = "1.0" )
769
+ customrope_base = ctk .StringVar (value = "10000" )
770
+
767
771
model_var = ctk .StringVar ()
768
772
lora_var = ctk .StringVar ()
769
773
lora_base_var = ctk .StringVar ()
@@ -904,6 +908,19 @@ def togglemiro(a,b,c):
904
908
# context size
905
909
makeslider (tokens_tab , "Context Size:" ,contextsize_text , context_var , 0 , 4 , 20 , set = 2 )
906
910
911
+
912
+ customrope_scale_entry , customrope_scale_label = makelabelentry (tokens_tab , "RoPE Scale:" , customrope_scale )
913
+ customrope_base_entry , customrope_base_label = makelabelentry (tokens_tab , "RoPE Base:" , customrope_base )
914
+ def togglerope (a ,b ,c ):
915
+ items = [customrope_scale_label , customrope_scale_entry ,customrope_base_label , customrope_base_entry ]
916
+ for idx , item in enumerate (items ):
917
+ if customrope_var .get () == 1 :
918
+ item .grid (row = 23 + int (idx / 2 ), column = idx % 2 , padx = 8 , stick = "nw" )
919
+ else :
920
+ item .grid_forget ()
921
+ makecheckbox (tokens_tab , "Custom RoPE Config" , variable = customrope_var , row = 22 , command = togglerope )
922
+ togglerope (1 ,1 ,1 )
923
+
907
924
# Model Tab
908
925
model_tab = tabcontent ["Model" ]
909
926
@@ -996,6 +1013,9 @@ def export_vars():
996
1013
args .mirostat = [int (mirostat_var .get ()), float (mirostat_tau .get ()), float (mirostat_eta .get ())] if usemirostat .get ()== 1 else None
997
1014
args .contextsize = int (contextsize_text [context_var .get ()])
998
1015
1016
+ if customrope_var .get ()== 1 :
1017
+ args .ropeconfig = [float (customrope_scale .get ()),float (customrope_base .get ())]
1018
+
999
1019
args .model_param = None if model_var .get () == "" else model_var .get ()
1000
1020
args .lora = None if lora_var .get () == "" else ([lora_var .get ()] if lora_base_var .get ()== "" else [lora_var .get (), lora_base_var .get ()])
1001
1021
@@ -1046,6 +1066,15 @@ def import_vars(dict):
1046
1066
1047
1067
if dict ["contextsize" ]:
1048
1068
context_var .set (contextsize_text .index (str (dict ["contextsize" ])))
1069
+
1070
+ if dict ["ropeconfig" ] and len (dict ["ropeconfig" ])> 1 :
1071
+ if dict ["ropeconfig" ][0 ]> 0 :
1072
+ customrope_var .set (1 )
1073
+ customrope_scale .set (str (dict ["ropeconfig" ][0 ]))
1074
+ customrope_base .set (str (dict ["ropeconfig" ][1 ]))
1075
+ else :
1076
+ customrope_var .set (0 )
1077
+
1049
1078
if dict ["blasbatchsize" ]:
1050
1079
blas_size_var .set (blasbatchsize_values .index (str (dict ["blasbatchsize" ])))
1051
1080
if dict ["forceversion" ]:
0 commit comments