2929custom_embedder_root_relative = os .path .relpath (custom_embedder_root , now_dir )
3030model_root_relative = os .path .relpath (model_root , now_dir )
3131
32+
3233def normalize_path (p ):
3334 return os .path .normpath (p ).replace ("\\ " , "/" ).lower ()
3435
36+
3537MODEL_FOLDER = re .compile (r"^(?:model.{0,4}|mdl(?:s)?|weight.{0,4}|zip(?:s)?)$" )
3638INDEX_FOLDER = re .compile (r"^(?:ind.{0,4}|idx(?:s)?)$" )
3739
@@ -205,6 +207,7 @@ def match_index(model_file_value):
205207
206208 return ""
207209
210+
208211def extract_model_and_epoch (path ):
209212 base_name = os .path .basename (path )
210213 match = re .match (r"(.+?)_(\d+)e_" , base_name )
@@ -264,6 +267,7 @@ def refresh_embedders_folders():
264267 ]
265268 return custom_embedders
266269
270+
267271names = get_files ("model" )
268272default_weight = names [0 ] if names else None
269273
@@ -274,6 +278,7 @@ def refresh_embedders_folders():
274278
275279CONFIG_PATH = os .path .join (now_dir , "assets" , "config.json" )
276280
281+
277282def save_realtime_settings (
278283 input_device , output_device , monitor_device , model_file , index_file
279284):
@@ -966,8 +971,6 @@ def toggle_visible_embedder_custom(embedder_model):
966971 return {"visible" : True , "__type__" : "update" }
967972 return {"visible" : False , "__type__" : "update" }
968973
969-
970-
971974 refresh_devices_button .click (
972975 fn = refresh_devices ,
973976 outputs = [input_audio_device , output_audio_device , monitor_output_device ],
@@ -1126,4 +1129,4 @@ def refresh_all():
11261129 output_audio_device ,
11271130 monitor_output_device ,
11281131 ],
1129- )
1132+ )
0 commit comments