mlabonne commited on
Commit
c472c57
1 Parent(s): dae0069

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -0
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ datasets:
4
+ - mlabonne/orpo-dpo-mix-40k
5
+ tags:
6
+ - abliterated
7
+ ---
8
+
9
+ This model is an experimental DPO fine-tune of an abliterated Llama 3 8B Instruct model on the full [mlabonne/orpo-dpo-mix-40k](https://huggingface.co/datasets/mlabonne/orpo-dpo-mix-40k) dataset.
10
+
11
+ It is currently being evaluated.
12
+
13
+ ## 💻 Usage
14
+
15
+ ```python
16
+ !pip install -qU transformers accelerate
17
+
18
+ from transformers import AutoTokenizer
19
+ import transformers
20
+ import torch
21
+
22
+ model = "mlabonne/Llama-3-8B-Instruct-abliterated-dpomix"
23
+ messages = [{"role": "user", "content": "What is a large language model?"}]
24
+
25
+ tokenizer = AutoTokenizer.from_pretrained(model)
26
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
27
+ pipeline = transformers.pipeline(
28
+ "text-generation",
29
+ model=model,
30
+ torch_dtype=torch.float16,
31
+ device_map="auto",
32
+ )
33
+
34
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
35
+ print(outputs[0]["generated_text"])
36
+ ```