Wrapper for simplified use of Llama2 GGUF quantized models.
Project description
gguf_llama
Provides a LlamaAI class with Python interface for generating text using Llama models.
Features
- Load Llama models and tokenizers automatically from gguf file
- Generate text completions for prompts
- Automatically adjust model size to fit longer prompts up to a specific limit
- Convenient methods for tokenizing and untokenizing text
- Fix text formatting issues before generating
Usage
from llama_ai import LlamaAI
ai = LlamaAI("my_model.gguf", max_tokens=500, max_input_tokens=100)"
Generate text by calling infer():
text = ai.infer("Once upon a time")
print(text)"
Installation
pip install gguf_llama
Documentation
See the API documentation for full details on classes and methods.
Contributing
Contributions are welcome! Open an issue or PR to improve gguf_llama.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gguf_llama-0.0.17.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file gguf_llama-0.0.17.tar.gz
.
File metadata
- Download URL: gguf_llama-0.0.17.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51839ab93c9badeac9730c8600fab14734c31455ef35d5758e0964038e1d58d7 |
|
MD5 | e5d98c7f0b78fbdee491efcac982c205 |
|
BLAKE2b-256 | b6f5fdbb836494d916bb719e2af9edbc730bd30e42985b0a9ee35017c4bd5f14 |
File details
Details for the file gguf_llama-0.0.17-py3-none-any.whl
.
File metadata
- Download URL: gguf_llama-0.0.17-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60d2c5c86f24bcfe602ad6763bb264ad8bd61d2f67b36a5f65ff97b16bfed4a2 |
|
MD5 | 482d93bc3f80eecbff4cf865daf1f336 |
|
BLAKE2b-256 | deeb49cb05e52650ffea487553ba81f93e48642a142dbeb24a2733d79991ce16 |