Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-4.0
|
3 |
+
---
|
4 |
+
|
5 |
+
finetuned by
|
6 |
+
|
7 |
+
dataset : jondurbin/truthy-dpo-v0.1
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
gpu code example
|
12 |
+
|
13 |
+
```
|
14 |
+
import torch
|
15 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
16 |
+
import math
|
17 |
+
|
18 |
+
## v2 models
|
19 |
+
model_path = "cloudyu/Pluto_24B_DPO_200"
|
20 |
+
|
21 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
|
22 |
+
model = AutoModelForCausalLM.from_pretrained(
|
23 |
+
model_path, torch_dtype=torch.bfloat16, device_map='auto',local_files_only=False, load_in_4bit=True
|
24 |
+
)
|
25 |
+
print(model)
|
26 |
+
prompt = input("please input prompt:")
|
27 |
+
while len(prompt) > 0:
|
28 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
|
29 |
+
|
30 |
+
generation_output = model.generate(
|
31 |
+
input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2
|
32 |
+
)
|
33 |
+
print(tokenizer.decode(generation_output[0]))
|
34 |
+
prompt = input("please input prompt:")
|
35 |
+
```
|