Update README.md
Browse files
README.md
CHANGED
|
@@ -8,7 +8,32 @@ tags:
|
|
| 8 |
- merge
|
| 9 |
|
| 10 |
---
|
| 11 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
| 14 |
|
|
|
|
| 8 |
- merge
|
| 9 |
|
| 10 |
---
|
| 11 |
+
# Eir
|
| 12 |
+
<img src="eir.png"/>
|
| 13 |
+
|
| 14 |
+
## How to use
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
!pip install -qU transformers accelerate
|
| 18 |
+
|
| 19 |
+
from transformers import AutoTokenizer
|
| 20 |
+
import transformers
|
| 21 |
+
import torch
|
| 22 |
+
|
| 23 |
+
model = "timpal0l/BeagleCatMunin2"
|
| 24 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
| 25 |
+
|
| 26 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 27 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 28 |
+
pipeline = transformers.pipeline(
|
| 29 |
+
"text-generation",
|
| 30 |
+
model=model,
|
| 31 |
+
torch_dtype=torch.float16,
|
| 32 |
+
device_map="auto",
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 36 |
+
print(outputs[0]["generated_text"])
|
| 37 |
|
| 38 |
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
| 39 |
|