Nope Nope commited on
Commit
8c6f1a5
1 Parent(s): 6e263b3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - microsoft/Phi-3-mini-128k-instruct
7
+ - gradientai/Llama-3-8B-Instruct-Gradient-1048k
8
+ - ise-uiuc/Magicoder-DS-6.7B
9
+ base_model:
10
+ - microsoft/Phi-3-mini-128k-instruct
11
+ - gradientai/Llama-3-8B-Instruct-Gradient-1048k
12
+ - ise-uiuc/Magicoder-DS-6.7B
13
+ ---
14
+
15
+ # HodgePodge
16
+
17
+ HodgePodge is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
18
+ * [microsoft/Phi-3-mini-128k-instruct](https://huggingface.co/microsoft/Phi-3-mini-128k-instruct)
19
+ * [gradientai/Llama-3-8B-Instruct-Gradient-1048k](https://huggingface.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k)
20
+ * [ise-uiuc/Magicoder-DS-6.7B](https://huggingface.co/ise-uiuc/Magicoder-DS-6.7B)
21
+
22
+ ## 🧩 Configuration
23
+
24
+ ```yaml
25
+ slices:
26
+ - sources:
27
+ - model: microsoft/Phi-3-mini-128k-instruct
28
+ layer_range: [0, 32]
29
+ - model: gradientai/Llama-3-8B-Instruct-Gradient-1048k
30
+ layer_range: [0, 32]
31
+ - model: ise-uiuc/Magicoder-DS-6.7B
32
+ layer_range: [0, 32]
33
+ merge_method: modelstock
34
+ base_model: microsoft/Phi-3-mini-128k-instruct
35
+ parameters:
36
+ t:
37
+ - filter: self_attn
38
+ value: [0, 0.5, 0.3, 0.7, 1]
39
+ - filter: mlp
40
+ value: [1, 0.5, 0.7, 0.3, 0]
41
+ - value: 0.5
42
+ dtype: bfloat16
43
+ ```
44
+
45
+ ## 💻 Usage
46
+
47
+ ```python
48
+ !pip install -qU transformers accelerate
49
+
50
+ from transformers import AutoTokenizer
51
+ import transformers
52
+ import torch
53
+
54
+ model = "fuzzymonstereatinganapple/HodgePodge"
55
+ messages = [{"role": "user", "content": "What is a large language model?"}]
56
+
57
+ tokenizer = AutoTokenizer.from_pretrained(model)
58
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
59
+ pipeline = transformers.pipeline(
60
+ "text-generation",
61
+ model=model,
62
+ torch_dtype=torch.float16,
63
+ device_map="auto",
64
+ )
65
+
66
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
67
+ print(outputs[0]["generated_text"])
68
+ ```