Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On macOS this was returning an incorrect path #741

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ramalama/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,14 @@ def build_prompt(self, args):
return prompt

def get_model_path(self, args):
model_path = self.exists(args)
if model_path:
return model_path

if args.dryrun:
return "/path/to/model"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, should we return something that indicates the model doesn't exist in the store already and we'd try to pull it?

Copy link
Collaborator Author

@ericcurtin ericcurtin Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should pull for "--dryrun", this is kinda just for, please print an approximate "podman run" command, "--dryrun" implies, don't do things like pull.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, nice fix though.

You can actually see the real command by executing ramalama --debug run MODEL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we should print an error in the case that the model does not exists. But I could be swayed either way.


model_path = self.exists(args)
if not model_path:
model_path = self.pull(args)
model_path = self.pull(args)

return model_path

Expand Down
Loading