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