File size: 1,243 Bytes
0ff94cd ac19e78 0ff94cd ac19e78 0ff94cd ac19e78 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
---
license: apache-2.0
language:
- en
- zh
library_name: transformers
widget:
- text: "<s> [|User|] Hi ๐ </s>[|Assistant|]"
---
This is a quantized version of [GeneZC/MiniChat-2-3B](https://huggingface.co/GeneZC/MiniChat-2-3B)
Optimum quantization using the command:
```bash
optimum-cli inc quantize --model GeneZC/MiniChat-2-3B --output ./mnch
```
Usage example:
```python
from optimum.intel import INCModelForCausalLM
from transformers import AutoTokenizer, pipeline, AutoModelForCausalLM
import torch
model_id = "Mihaiii/MiniChat-2-3B-optimum-intel"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = INCModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [
{
"role": "system",
"content": "You are a friendly chatbot who always responds in the style of a pirate",
},
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
]
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.0001, repetition_penalty=1.2)
print(outputs[0]["generated_text"])
``` |