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

Simple Example #179

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Simple Example #179

merged 5 commits into from
Jun 18, 2024

Conversation

royjhan
Copy link
Contributor

@royjhan royjhan commented Jun 5, 2024

Could show cpu vs gpu proportion calculations if helpful but just pushing the response for now

from ollama import ps

response = ps()
print(response)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This example should be a bit more involved. To really show ps, you should load a model by calling chat or generate

from ollama import ps, pull, chat

pull('mistral')
chat('mistral', messages=[{'role': 'user', 'content': 'Pick a number'}])
Copy link
Collaborator

Choose a reason for hiding this comment

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

it might be useful to output the output content

@@ -0,0 +1,20 @@
from ollama import ps, pull, chat

pull('mistral')
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: pull blocks without feedback since it doesn't stream which leaves the user wondering what's going on

@mxyng mxyng merged commit 982d65f into main Jun 18, 2024
5 checks passed
@mxyng mxyng deleted the royh-ps-example branch June 18, 2024 20:23
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.

None yet

2 participants