de-coder commited on
Commit
a61b2db
1 Parent(s): 640f687

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -13
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 bitsandbytes
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 transformers import AutoTokenizer, AutoModelForCausalLM
45
- import bitsandbytes as bnb
46
 
47
- # Load the quantized model
48
- model = AutoModelForCausalLM.from_pretrained("de-coder/UlizaLlama_Q4_K_M-gguf",
49
- device_map="auto",
50
- trust_remote_code=True)
51
- tokenizer = AutoTokenizer.from_pretrained("de-coder/UlizaLlama_Q4_K_M-gguf")
 
52
 
53
- # Example usage
54
  prompt = "Niambie kuhusu historia ya Kilimanjaro."
55
- input_ids = tokenizer(prompt, return_tensors="pt").input_ids
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