Skip to content

Commit

Permalink
possible fix for #31
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayrsn committed Dec 7, 2022
1 parent 4fe9875 commit b2bdba8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cli/base_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def get_model_path(name_version):

# a function that updates aimodels-lock.json
def update_ai_models_lock(name, version, path):
# make name and version case insensitive
name = name.lower()
version = version.lower()
# get current working directory
cwd = os.getcwd()
aimodels_lock_file = os.path.join(cwd, "aimodels-lock.json")
Expand Down
4 changes: 2 additions & 2 deletions cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def install(name_version: Optional[str] = typer.Argument(None),
typer.echo(f"Error: Model {name}:{version} not found")
return

save_path = os.path.join(aimmApp.main_dir, name, version)
save_path = os.path.join(aimmApp.main_dir, name.lower(), version.lower())
if not os.path.exists(save_path):
os.makedirs(save_path)
# if auth_required is set, check for creds
Expand Down Expand Up @@ -132,6 +132,6 @@ def install(name_version: Optional[str] = typer.Argument(None),
json.dump(aimmApp.installed, file, indent=4)
typer.echo(f"Installed {name}:{version}!")
else:
save_path = os.path.join(aimmApp.main_dir, name, version)
save_path = os.path.join(aimmApp.main_dir, name.lower(), version.lower())
base_funcs.update_ai_models_lock(name, version, save_path)
typer.echo(f"Found Local: {name}:{version}")

0 comments on commit b2bdba8

Please sign in to comment.