Update README.md
Browse files
README.md
CHANGED
@@ -24,12 +24,12 @@ language:
|
|
24 |
- en
|
25 |
metrics:
|
26 |
- accuracy
|
27 |
-
- code_eval
|
28 |
-
- bleu
|
29 |
- brier_score
|
|
|
|
|
30 |
---
|
31 |
|
32 |
-
# LeroyDyer/
|
33 |
|
34 |
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
35 |
|
@@ -113,39 +113,52 @@ print(response.text)
|
|
113 |
```
|
114 |
|
115 |
|
|
|
|
|
|
|
|
|
116 |
|
117 |
|
118 |
-
|
119 |
-
# 1. Method1
|
120 |
-
|
121 |
```
|
122 |
|
123 |
|
124 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
125 |
|
126 |
-
|
127 |
-
model = AutoModelForCausalLM.from_pretrained("LeroyDyer/Mixtral_AI_128K_B_7b", trust_remote_code=True)
|
128 |
|
129 |
|
130 |
```
|
131 |
|
132 |
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
|
|
|
137 |
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
-
tokenizer = AutoTokenizer.from_pretrained("LeroyDyer/Mixtral_AI_128k_7b-GGUF",
|
141 |
-
use_flash_attention_2=True,
|
142 |
-
torch_dtype=torch.bfloat16,
|
143 |
-
device_map="auto", trust_remote_code=True)
|
144 |
|
145 |
-
model = AutoModelForCausalLM.from_pretrained("LeroyDyer/Mixtral_AI_128k_7b-GGUF",
|
146 |
-
use_flash_attention_2=True,
|
147 |
-
torch_dtype=torch.bfloat16,
|
148 |
-
device_map="auto", trust_remote_code=True)
|
149 |
|
150 |
|
151 |
|
|
|
24 |
- en
|
25 |
metrics:
|
26 |
- accuracy
|
|
|
|
|
27 |
- brier_score
|
28 |
+
- code_eval
|
29 |
+
pipeline_tag: text-generation
|
30 |
---
|
31 |
|
32 |
+
# LeroyDyer/Mixtral_AI_128K_B
|
33 |
|
34 |
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
35 |
|
|
|
113 |
```
|
114 |
|
115 |
|
116 |
+
```
|
117 |
+
pip install transformers==4.34.0
|
118 |
+
pip install flash-attn==2.3.1.post1 --no-build-isolation
|
119 |
+
pip install accelerate==0.23.0
|
120 |
|
121 |
|
|
|
|
|
|
|
122 |
```
|
123 |
|
124 |
|
|
|
125 |
|
126 |
+
## METHOD 2
|
|
|
127 |
|
128 |
|
129 |
```
|
130 |
|
131 |
|
132 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
133 |
+
import transformers
|
134 |
+
import torch
|
135 |
|
136 |
+
model_id = "LeroyDyer/Mixtral_AI_128K_B"
|
137 |
|
138 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
139 |
+
model = AutoModelForCausalLM.from_pretrained(model_id,
|
140 |
+
torch_dtype=torch.bfloat16,
|
141 |
+
use_flash_attention_2=True,
|
142 |
+
device_map="auto", trust_remote_code=True)
|
143 |
+
pipeline = transformers.pipeline(
|
144 |
+
"text-generation",
|
145 |
+
model=model,
|
146 |
+
tokenizer=tokenizer,
|
147 |
+
)
|
148 |
+
prompt = "<|prompter|>What are the main challenges to support a long context for LLM?</s><|assistant|>"
|
149 |
+
|
150 |
+
sequences = pipeline(
|
151 |
+
prompt,
|
152 |
+
max_new_tokens=400,
|
153 |
+
do_sample=False,
|
154 |
+
return_full_text=False,
|
155 |
+
num_return_sequences=1,
|
156 |
+
eos_token_id=tokenizer.eos_token_id,
|
157 |
+
)
|
158 |
+
for seq in sequences:
|
159 |
+
print(f"{seq['generated_text']}")
|
160 |
|
|
|
|
|
|
|
|
|
161 |
|
|
|
|
|
|
|
|
|
162 |
|
163 |
|
164 |
|