Skip to content

Commit

Permalink
Merge pull request #204 from haesleinhuepf/persistent_endpoint_config
Browse files Browse the repository at this point in the history
Persistent endpoint config
  • Loading branch information
haesleinhuepf authored Sep 3, 2024
2 parents 0fec557 + eba27a0 commit a0ccd9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bia_bob/_machinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def init_assistant(model=None, auto_execute:bool = False, variables:dict=None, e
config = {
"model": DEFAULT_MODEL,
"vision_model": DEFAULT_VISION_MODEL,
"endpoint": None,
}

# load config from disk
Expand All @@ -222,10 +223,13 @@ def init_assistant(model=None, auto_execute:bool = False, variables:dict=None, e
model = config["model"]
if vision_model is None:
vision_model = config["vision_model"]
if endpoint is None:
endpoint = config["endpoint"]

# store config to disk
config["model"] = model
config["vision_model"] = vision_model
config["endpoint"] = endpoint
with open(config_filename, 'w') as file:
yaml.dump(config, file, default_flow_style=False)

Expand Down

0 comments on commit a0ccd9b

Please sign in to comment.