Samee-ur commited on
Commit
427740b
1 Parent(s): 1c81b8b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -5,4 +5,35 @@ datasets:
5
  - Intel/orca_dpo_pairs
6
  language:
7
  - en
8
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  - Intel/orca_dpo_pairs
6
  language:
7
  - en
8
+ ---
9
+
10
+ # NeuralPipe-7B-slerp-DPO
11
+
12
+ NeuralPipe-7B-slerp is a Direct Preference Optimized version of a merge of [Samee-ur/NeuralPipe-7B-slerp](https://huggingface.co/Samee-ur/NeuralPipe-7B-slerp).
13
+ I performed Direct Preference Optimization on the [Intel/orca_dpo_pairs dataset](https://huggingface.co/datasets/Intel/orca_dpo_pairs)
14
+
15
+
16
+ ## 💻 Usage
17
+
18
+ ```python
19
+ !pip install -qU transformers accelerate
20
+
21
+ from transformers import AutoTokenizer
22
+ import transformers
23
+ import torch
24
+
25
+ model = "Samee-ur/NeuralPipe-7B-slerp-DPO"
26
+ messages = [{"role": "user", "content": "What is a large language model?"}]
27
+
28
+ tokenizer = AutoTokenizer.from_pretrained(model)
29
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
30
+ pipeline = transformers.pipeline(
31
+ "text-generation",
32
+ model=model,
33
+ torch_dtype=torch.float16,
34
+ device_map="auto",
35
+ )
36
+
37
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
38
+ print(outputs[0]["generated_text"])
39
+ ```