GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - namtranase/gemma-cpp-python: A Python wrapper for gemma.cpp

BranchesTags
Open more actions menu

Latest commit

 

History

48 Commits
48 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
asset
asset
 
 
examples
examples
 
 
model
model
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
DEVELOPERS.md
DEVELOPERS.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

gemma-cpp-python: Python Bindings for gemma.cpp

Latest Version: v0.1.3.post3

  • Fixed absolute path for libsentencepiece.0.0.0.dylib
  • Interface changes due to updates in gemma.cpp.
  • Enhanced user experience for ease of use 🙏. Give it a try!

License: MIT

gemma-cpp-python provides Python bindings for gemma, a high-performance C++ library, bridging advanced computational functionalities to Python.

🙏 Acknowledgments

Special thanks to the creators and contributors of gemma.cpp for their foundational work.

💬 Demo Chat and Chat with Website!

Check out the new chat demo included in the examples directory! This interactive interface showcases how you can engage in real-time conversations with the Gemma model.

For the Chat with Website, please visit the tutorial for more detail/

Using Gemma to chat with website

Gemma Cpp Python Chat with Website Demo

Chat with Gemma

Gemma Cpp Python Chat Demo

🛠 Installation

Prerequisites: Ensure Python 3.8+ and pip are installed.

System requirements: For now, I only tested it on the Unix-like Platforms and the MacOS. Please visit the gemma.cpp installation for more details.

Models: pygemma supported 2b-it-sfp model for now, to install model, please visit here

Install from PyPI

For a quick setup, install directly from PyPI:

pip install pygemma==0.1.3

For Developers: Install from Source

To install the latest version or for development purposes:

  1. Clone the repo and enter the directory:
git clone https://github.com/namtranase/gemma-cpp-python.git
cd gemma-cpp-python
  1. Install Python dependencies and pygemma:
pip install .

🖥 Usage

To acctually run the model, you need to install the model followed on the gemma.cpp repo

For usage examples, refer to tests/test_chat.py. Here's a quick start:

from pygemma import Gemma
gemma = Gemma()
gemma.show_help()
gemma.show_config()
gemma.load_model("/path/to/tokenizer", "/path/to/compressed_weight/", "model_type")
gemma.completion("Write a poem")

To run the demo on your local machine:

cd gemma-cpp-python/examples
pip install -r requirements.txt
streamlit run streamlit_demo.py

🤝 Contributing

Contributions are welcome. Please clone the repository, push your changes to a new branch, and submit a pull request.

License

gemma-cpp-python is MIT licensed. See the LICENSE file for details.

About

A Python wrapper for gemma.cpp

Resources

Readme
MIT license
Activity

Stars

54 stars

Watchers

2 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.