Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
|
5 |
+
# MoMo-70B-lora-1.8.6-DPO based model with gradient slerp
|
6 |
+
|
7 |
+
This is an English mixed Model based on
|
8 |
+
* [moreh/MoMo-70B-lora-1.8.6-DPO]
|
9 |
+
|
10 |
+
gpu code example
|
11 |
+
|
12 |
+
```
|
13 |
+
import torch
|
14 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
15 |
+
import math
|
16 |
+
|
17 |
+
## v2 models
|
18 |
+
model_path = "kodonho/kodonho/Momo-70b-DPO-mixed"
|
19 |
+
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
|
21 |
+
model = AutoModelForCausalLM.from_pretrained(
|
22 |
+
model_path, torch_dtype=torch.float32, device_map='auto',local_files_only=False, load_in_4bit=True
|
23 |
+
)
|
24 |
+
print(model)
|
25 |
+
prompt = input("please input prompt:")
|
26 |
+
while len(prompt) > 0:
|
27 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
|
28 |
+
|
29 |
+
generation_output = model.generate(
|
30 |
+
input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2
|
31 |
+
)
|
32 |
+
print(tokenizer.decode(generation_output[0]))
|
33 |
+
prompt = input("please input prompt:")
|
34 |
+
```
|