SoTA Transformers with C-backend for fast inference on your CPU.
We identify three pillers to enable fast inference of SoTA AI models on your CPU:
This project aims to address the third using LLaMa.cpp and GGML.
pip install cformers should be good to get started.And most importantly:
Setup
pip install transformers wget
git clone https://github.com/nolanoOrg/cformers.git
cd cformers/cformers/cpp && make && cd ..
Usage:
from interface import AutoInference as AI
ai = AI('EleutherAI/gpt-j-6B')
x = ai.generate('def parse_html(html_doc):', num_tokens_to_generate=500)
print(x['token_str'])
OR
from interface import AutoInference as AI
ai = AI('OpenAssistant/oasst-sft-1-pythia-12b')
x = ai.generate("<|prompter|>What's the Earth total population<|endoftext|><|assistant|>", num_tokens_to_generate=100)
print(x['token_str'])
OR
python chat.py
chat.py accepts the following parameteres:
-t 100 Number of tokens to generate-p Tell me a joke for a single prompt interaction-m pythia to load one of the available (bloom, pythia or gptj )We are working on adding support for pip install cformers.
Following Architectures are supported:
Currently following huggingface models are supported:
We need to quantize and upload remaining models based on the supported architectures on huggingface. We would appreciate your help in this regard.
Features:
Code-base restructuring:
For now, we are focussing on AutoRegressive-style generative models.
We encourage contributions from the community.
Following are some easy first issues ways in which you can help improve CTransformers:
ctransformers/map_model_to_url.pyIf you are allergic to Python, you can:
You can also contribute to LLaMa.cpp and we will port those niceties here.
Our interface is still limited to generation. We are working to support other features:
We would love to hear from you various ways in which we can speed up and improve the interface.
MIT License
Discord: https://discord.gg/HGujTPQtR6
C
58.2%
C++
32.4%
Python
8.4%
SoTA Transformers with C-backend for fast inference on your CPU.
We identify three pillers to enable fast inference of SoTA AI models on your CPU:
This project aims to address the third using LLaMa.cpp and GGML.
pip install cformers should be good to get started.And most importantly:
Setup
pip install transformers wget
git clone https://github.com/nolanoOrg/cformers.git
cd cformers/cformers/cpp && make && cd ..
Usage:
from interface import AutoInference as AI
ai = AI('EleutherAI/gpt-j-6B')
x = ai.generate('def parse_html(html_doc):', num_tokens_to_generate=500)
print(x['token_str'])
OR
from interface import AutoInference as AI
ai = AI('OpenAssistant/oasst-sft-1-pythia-12b')
x = ai.generate("<|prompter|>What's the Earth total population<|endoftext|><|assistant|>", num_tokens_to_generate=100)
print(x['token_str'])
OR
python chat.py
chat.py accepts the following parameteres:
-t 100 Number of tokens to generate-p Tell me a joke for a single prompt interaction-m pythia to load one of the available (bloom, pythia or gptj )We are working on adding support for pip install cformers.
Following Architectures are supported:
Currently following huggingface models are supported:
We need to quantize and upload remaining models based on the supported architectures on huggingface. We would appreciate your help in this regard.
Features:
Code-base restructuring:
For now, we are focussing on AutoRegressive-style generative models.
We encourage contributions from the community.
Following are some easy first issues ways in which you can help improve CTransformers:
ctransformers/map_model_to_url.pyIf you are allergic to Python, you can:
You can also contribute to LLaMa.cpp and we will port those niceties here.
Our interface is still limited to generation. We are working to support other features:
We would love to hear from you various ways in which we can speed up and improve the interface.
MIT License
Discord: https://discord.gg/HGujTPQtR6
C
58.2%
C++
32.4%
Python
8.4%