create databases directory on startup (#3518)

This PR creates the databases directory at app startup time. It also
removes a couple of debugging statements that were inadvertently left in
the model manager.
This commit is contained in:
blessedcoolant 2023-06-08 23:40:32 +12:00 committed by GitHub
commit fe8f3381fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -57,6 +57,7 @@ class ApiDependencies:
# TODO: build a file/path manager?
db_location = config.db_path
db_location.parent.mkdir(parents=True,exist_ok=True)
graph_execution_manager = SqliteItemStorage[GraphExecutionState](
filename=db_location, table_name="graph_executions"

View File

@ -220,6 +220,7 @@ def invoke_cli():
db_location = ":memory:"
else:
db_location = config.db_path
db_location.parent.mkdir(parents=True,exist_ok=True)
logger.info(f'InvokeAI database location is "{db_location}"')

View File

@ -320,11 +320,7 @@ class ModelManager(object):
models = {}
for name in sorted(self.config, key=str.casefold):
stanza = self.config[name]
with open('log.txt','a') as file:
print(f'DEBUG: name={name}; stanza = {stanza}',file=file)
# don't include VAEs in listing (legacy style)
if "config" in stanza and "/VAE/" in stanza["config"]:
continue
@ -1355,8 +1351,6 @@ class ModelManager(object):
short_names = OmegaConf.load(Dataset_path).get('lora') or {}
for name in model_names:
print(name)
name = short_names.get(name) or name
# HuggingFace style LoRA