GithubHelp home page GithubHelp logo

hubayirp / pygmalion.cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alpindale/pygmalion.cpp

0.0 0.0 0.0 238 KB

C/C++ implementation of PygmalionAI/pygmalion-6b

License: MIT License

Shell 0.20% C 97.02% CMake 2.78%

pygmalion.cpp's Introduction

pygmalion.cpp

Forked from ggerganov/ggml.

Repository Status: Inactive

This repository is currently inactive and is not being actively maintained or updated. Feel free to use the code as-is, but please note that no further development or bug fixes are planned at this time.

If you have any questions or issues with the code, please feel free to open an issue and I'll do my best to assist you. However, please understand that my response times may be slower than usual.

The project has moved in part to LostRuins/koboldcpp where new features are added constantly.


pygmalion.cpp is an implementation of the popular language model, Pygmalion 6B, in C/C++. This allows the large language model to run directly on the CPU. The weights provided here are quantized down to 4-bit integers (from the original 16-bit floating points) - the 6.4x size reduction and the efficient quantization enables the model to run on devices with 8GB of RAM (not VRAM!). This is still a work-in-progress, so please report any issues here.

Features

  • Written in C
  • 16-bit float support
  • 4-bit integer support
  • Automatic differentiation (work in progress)
  • ADAM and L-BFGS optimizers
  • Optimized for Apple silicon via NEON intrinsics and Accelerate framework
  • On x86 architectures utilzes AVX intrinsics
  • No third-party dependencies
  • Zero memory allocations during runtime

Current issues

  • Unlimited text generation
  • Tags (such as <START>, Scenario) are generated

Roadmap

  • Example of Pygmalion-6B inference examples/pyggy
  • Support 4-bit integer quantization
  • Chat mode - Now implemented!
  • Fix the current issues
  • Clean up the code

Pygmalion-6B inference (example)

With ggml you can efficiently run Pygmalion-6B inference on the CPU.

Here is how to run the example programs:

# Build pygmalion.cpp + examples
git clone https://github.com/AlpinDale/pygmalion.cpp
cd pygmalion.cpp
mkdir build && cd build
cmake ..
make -j4 pyggy

# Run the Pygmalion 6B model (quantized to 4-bits, requires around 6GB of RAM for full ctx). Using the main branch model as an example:
../examples/pyggy/download.sh
./bin/pyggy -m models/pygmalion-6b-v3-q4_0.bin

Android guide

You need an android phone with at least 8GB of RAM.

  1. Install Termux from the Google Play Store.

If Google Play Store says your phone is too new, download from here.

  1. Open Termux and run each of the commands below in order:
pkg install clang wget

apt install git build-essential

git clone https://github.com/AlpinDale/pygmalion.cpp && cd pygmalion.cpp

mkdir build && cd build

cmake ..

make pyggy

This will install pygmalion.cpp. To download the model, run:

chmod +x ../examples/pyggy/download.sh

../examples/pyggy/download.sh

And to run pygmalion.cpp:

./bin/pyggy -m models/pygmalion-6b-v3-q4_0.bin

For more information, checkout the corresponding programs in the examples folder.

pygmalion.cpp's People

Contributors

alpindale 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.