Giter Club home page Giter Club logo

gemma-cpp-python's Introduction

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.

gemma-cpp-python's People

Contributors

namtranase avatar phamson02 avatar pagakarthik avatar bachvudinh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.