Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A dev container with ollama and ollama examples with the Python OpenAI SDK

License

NotificationsYou must be signed in to change notification settings

pamelafox/ollama-python-playground

Repository files navigation

This project is designed to be opened in GitHub Codespaces as an easy way for anyone to try out SLMs (small language models) entirely in the browser.

  1. Open the Codespace in the browser using theCode button at the top of the repository.

  2. Once the Codespace is loaded, it should haveollama pre-installed as well as theOpenAI Python SDK.

  3. Ask Ollama to run the SLM of your choice. For example, to run thephi3 model:

    ollama run phi3:mini

    That will take a few minutes to download the model into the Codespace.

  4. Once you see "success" in the output, you can send a message to that model from the prompt.

    >>> Write a haiku about hungry hippos
  5. After several seconds, you should see a response stream in from the model.

  6. To learn about different techniques used with language models, open the Python notebookollama.ipynb and run each cell . If you used a model other than 'phi3:mini', change theMODEL_NAME in the first cell.

  7. To have a conversation with a model from Python, open the Python filechat_history.py and run it. You can change theMODEL_NAME at the top of the file as needed, and you can also modify the system message or add few-shot examples if desired.

Additional resources

For more information about working with the Phi-3 model, check out thePhi-3 Cookbook.

To learn more about generative AI generally, check outGenerative AI for beginners.

For example code that works with OpenAI models as well, trypython-openai-demos.

About

A dev container with ollama and ollama examples with the Python OpenAI SDK

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp