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

Implement ramalama run/serve #8

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Implement ramalama run/serve #8

merged 1 commit into from
Jul 30, 2024

Conversation

ericcurtin
Copy link
Collaborator

@ericcurtin ericcurtin commented Jul 30, 2024

Now we can run "ramalama run/serve granite-code", if not using
container, one must at least build/install llama.cpp. Added huggingface
support.

@@ -68,9 +68,9 @@ def run_curl_command(args, filename):
sys.exit(e.returncode)


def pull_ollama_manifest(ramalama_store, manifests, accept, registry_head, model_tag):
def pull_ollama_manifest(repos_ollama, manifests, accept, registry_head, model_tag):
Copy link
Member

Choose a reason for hiding this comment

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

Why not just call it repos. No need to keep repeating _ollama

Copy link
Collaborator Author

@ericcurtin ericcurtin Jul 30, 2024

Choose a reason for hiding this comment

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

My thinking was shortly I will bring in huggingface support again and there will likely be "repos_hf", "repos_ollama" directory is:

~/.local/share/ramalama/repos/ollama

shortly there will be:

~/.local/share/ramalama/repos/huggingface

Copy link
Member

Choose a reason for hiding this comment

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

I think you should embed the location of the store inside of the functions, and not force it to be different.

Once we have multiple pull_manifests() functions, then we can start to consildate functionality and get as much reuse as possible.

ramalama Outdated
command = sys.argv[1]
if command == "pull" and len(sys.argv) > 2:
pull_cli(ramalama_store + "/repos/ollama",
ramalama_store + "/models/ollama", sys.argv[2])
pull_cli(ramalama_store, sys.argv[2])
Copy link
Member

Choose a reason for hiding this comment

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

switch command {
case "pull":
case "run":
}

Copy link
Member

Choose a reason for hiding this comment

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

Do you have commands that handle 2 options?

Copy link
Collaborator Author

@ericcurtin ericcurtin Jul 30, 2024

Choose a reason for hiding this comment

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

Yeah there will be:

ramalama list/ls

as an example that lists all models downloaded and ready to use, it's coming.

Will change to switch, apparently they call it match in python for some reason

Copy link
Collaborator Author

@ericcurtin ericcurtin Jul 30, 2024

Choose a reason for hiding this comment

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

How would we feel about going back to if/else if/else? The python switch equivalent match is only available from Python 3.10 (2021) onwards and macOS build is failing here, I'm guessing the python3 version on macOS is older

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Going back to if, else, etc. fixed it anyway

@ericcurtin ericcurtin force-pushed the ramalama-run branch 6 times, most recently from 569718d to 1bd8647 Compare July 30, 2024 20:19
Now we can run "ramalama run/serve granite-code", if not using
container, one must at least build/install llama.cpp. Added huggingface
support.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
@ericcurtin ericcurtin changed the title Implement ramalama run Implement ramalama run/serve Jul 30, 2024
@rhatdan
Copy link
Member

rhatdan commented Jul 30, 2024

Ok merging, we can cleanup later.

@rhatdan rhatdan merged commit 4aa5fde into main Jul 30, 2024
5 checks passed
@ericcurtin ericcurtin deleted the ramalama-run branch July 30, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants