Update README.md
Browse files
README.md
CHANGED
@@ -32,8 +32,7 @@ UlizaLlama_Q4_K_M-gguf is a 4-bit quantized version of the UlizaLlama model, a 7
|
|
32 |
To use UlizaLlama-QQUF, you'll need a library that supports 4-bit quantized models. We recommend using the `bitsandbytes` library:
|
33 |
|
34 |
```bash
|
35 |
-
pip install
|
36 |
-
pip install transformers
|
37 |
```
|
38 |
|
39 |
## Usage
|
@@ -41,20 +40,18 @@ pip install transformers
|
|
41 |
Here's a simple example of how to load and use de-coder/UlizaLlama_Q4_K_M-gguf
|
42 |
|
43 |
```python
|
44 |
-
from
|
45 |
-
import bitsandbytes as bnb
|
46 |
|
47 |
-
# Load the
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
|
53 |
-
#
|
54 |
prompt = "Niambie kuhusu historia ya Kilimanjaro."
|
55 |
-
|
56 |
-
output = model.generate(input_ids, max_length=100)
|
57 |
-
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
58 |
```
|
59 |
|
60 |
## Performance and Trade-offs
|
|
|
32 |
To use UlizaLlama-QQUF, you'll need a library that supports 4-bit quantized models. We recommend using the `bitsandbytes` library:
|
33 |
|
34 |
```bash
|
35 |
+
!pip install ctransformers
|
|
|
36 |
```
|
37 |
|
38 |
## Usage
|
|
|
40 |
Here's a simple example of how to load and use de-coder/UlizaLlama_Q4_K_M-gguf
|
41 |
|
42 |
```python
|
43 |
+
from ctransformers import AutoModelForCausalLM
|
|
|
44 |
|
45 |
+
# Load the model
|
46 |
+
llm = AutoModelForCausalLM.from_pretrained(
|
47 |
+
"de-coder/UlizaLlama_Q4_K_M-gguf",
|
48 |
+
model_file="Q4_K_M.gguf",
|
49 |
+
lib="avx2" # or "basic" if avx2 isn't supported
|
50 |
+
)
|
51 |
|
52 |
+
# Generate text
|
53 |
prompt = "Niambie kuhusu historia ya Kilimanjaro."
|
54 |
+
print(llm(prompt))
|
|
|
|
|
55 |
```
|
56 |
|
57 |
## Performance and Trade-offs
|