Skip to content

Commit

Permalink
Fix downloading model on the first run
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 23, 2024
1 parent 4311204 commit 68f786a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions r2ai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ def get_hf_llm(ai, repo_id, debug_mode, context_window):
usermodels = json.load(fd)
fd.close()
except:
usermodels = {}
pass
model_path = "" # slurp(r2ai_model_json)
if not repo_id:
repo_id = get_default_model()
elif repo_id.startswith ("-m "):
repo_id = repo_id[3:]
if usermodels is not None and repo_id in usermodels:
model_path = usermodels[repo_id]
# print(f"[r2ai] Using {r2ai_model_json} {model_path}")
Expand Down

0 comments on commit 68f786a

Please sign in to comment.