cstr commited on
Commit
8fbddd1
1 Parent(s): bb66844

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +58 -0
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - mlabonne/OrpoLlama-3-8B
7
+ - DiscoResearch/Llama3_DiscoLM_German_8b_v0.1_experimental
8
+ base_model:
9
+ - mlabonne/OrpoLlama-3-8B
10
+ - DiscoResearch/Llama3_DiscoLM_German_8b_v0.1_experimental
11
+ ---
12
+
13
+ # llama3-discolm-orpo-t2
14
+
15
+ llama3-discolm-orpo-t2 is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
16
+ * [mlabonne/OrpoLlama-3-8B](https://huggingface.co/mlabonne/OrpoLlama-3-8B)
17
+ * [DiscoResearch/Llama3_DiscoLM_German_8b_v0.1_experimental](https://huggingface.co/DiscoResearch/Llama3_DiscoLM_German_8b_v0.1_experimental)
18
+
19
+ ## 🧩 Configuration
20
+
21
+ ```yaml
22
+ slices:
23
+ - sources:
24
+ - model: mlabonne/OrpoLlama-3-8B
25
+ layer_range: [0, 32]
26
+ - model: DiscoResearch/Llama3_DiscoLM_German_8b_v0.1_experimental
27
+ layer_range: [0, 32]
28
+ merge_method: slerp
29
+ base_model: mlabonne/OrpoLlama-3-8B
30
+ parameters:
31
+ value: [0, 0.5, 0.7, 0.9]
32
+ dtype: bfloat16
33
+ ```
34
+
35
+ ## 💻 Usage
36
+
37
+ ```python
38
+ !pip install -qU transformers accelerate
39
+
40
+ from transformers import AutoTokenizer
41
+ import transformers
42
+ import torch
43
+
44
+ model = "cstr/llama3-discolm-orpo-t2"
45
+ messages = [{"role": "user", "content": "What is a large language model?"}]
46
+
47
+ tokenizer = AutoTokenizer.from_pretrained(model)
48
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
49
+ pipeline = transformers.pipeline(
50
+ "text-generation",
51
+ model=model,
52
+ torch_dtype=torch.float16,
53
+ device_map="auto",
54
+ )
55
+
56
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
57
+ print(outputs[0]["generated_text"])
58
+ ```