abhishekchohan commited on
Commit
4f2fc4b
1 Parent(s): 7496e9a

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -0
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - Intel/orca_dpo_pairs
5
+ - nvidia/HelpSteer
6
+ - jondurbin/truthy-dpo-v0.1
7
+ language:
8
+ - en
9
+ library_name: transformers
10
+ pipeline_tag: text-generation
11
+ ---
12
+
13
+ ### Yi-9B-Forest-DPO
14
+ Introducing Yi-9B-Forest-DPO, a LLM fine-tuned with base model 01-ai/Yi-9B, using direct preference optimization.
15
+ This model showcases exceptional prowess across a spectrum of natural language processing (NLP) tasks.
16
+
17
+ A mixture of the following datasets was used for fine-tuning.
18
+
19
+ 1. Intel/orca_dpo_pairs
20
+ 2. nvidia/HelpSteer
21
+ 3. jondurbin/truthy-dpo-v0.1
22
+
23
+
24
+ 💻 Usage
25
+
26
+ ```python
27
+ !pip install -qU transformers bitsandbytes accelerate
28
+
29
+ from transformers import AutoTokenizer
30
+ import transformers
31
+ import torch
32
+
33
+ model = "abhishekchohan/Yi-9B-Forest-DPO"
34
+
35
+ tokenizer = AutoTokenizer.from_pretrained(model)
36
+ pipeline = transformers.pipeline(
37
+ "text-generation",
38
+ model=model,
39
+ model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
40
+ )
41
+
42
+ messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
43
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
44
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
45
+ print(outputs[0]["generated_text"])
46
+
47
+ ```