summaryrefslogtreecommitdiffstats
path: root/g4f/locals
diff options
context:
space:
mode:
authorZed <33319711+Zedai00@users.noreply.github.com>2024-05-30 15:59:16 +0200
committerGitHub <noreply@github.com>2024-05-30 15:59:16 +0200
commitcb2776a5497f2e4f14aeb18fc372ea4d237530bd (patch)
tree6db9d574b93efe8867f1ee866edede95f5290e8f /g4f/locals
parentUpdate README.md (diff)
downloadgpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.tar
gpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.tar.gz
gpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.tar.bz2
gpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.tar.lz
gpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.tar.xz
gpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.tar.zst
gpt4free-cb2776a5497f2e4f14aeb18fc372ea4d237530bd.zip
Diffstat (limited to 'g4f/locals')
-rw-r--r--g4f/locals/models.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/g4f/locals/models.py b/g4f/locals/models.py
index f82f5448..8e1c06bf 100644
--- a/g4f/locals/models.py
+++ b/g4f/locals/models.py
@@ -37,8 +37,10 @@ def get_model_dir() -> str:
local_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(os.path.dirname(local_dir))
model_dir = os.path.join(project_dir, "models")
- if os.path.exists(model_dir):
- return model_dir
+ if not os.path.exists(model_dir):
+ os.mkdir(model_dir)
+ return model_dir
+
def get_models() -> dict[str, dict]:
model_dir = get_model_dir()
@@ -48,4 +50,4 @@ def get_models() -> dict[str, dict]:
else:
models = load_models()
save_models(file_path, models)
- return models \ No newline at end of file
+ return models