Or4cl3-1 commited on
Commit
f805829
1 Parent(s): a84889a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +83 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - SuperAGI/SAM
7
+ - GoogleAI/Gemini
8
+ - bigscience/bloom
9
+ - openai/opt-175b
10
+ - deepmind/gopher
11
+ - microsoft/megatron-turing-nlg
12
+ base_model:
13
+ - SuperAGI/SAM
14
+ - GoogleAI/Gemini
15
+ - bigscience/bloom
16
+ - openai/opt-175b
17
+ - deepmind/gopher
18
+ - microsoft/megatron-turing-nlg
19
+ ---
20
+
21
+ # SAM-Gemini-BLOOM-OPT-Gopher-Megatron-slerp
22
+
23
+ SAM-Gemini-BLOOM-OPT-Gopher-Megatron-slerp is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
24
+ * [SuperAGI/SAM](https://huggingface.co/SuperAGI/SAM)
25
+ * [GoogleAI/Gemini](https://huggingface.co/GoogleAI/Gemini)
26
+ * [bigscience/bloom](https://huggingface.co/bigscience/bloom)
27
+ * [openai/opt-175b](https://huggingface.co/openai/opt-175b)
28
+ * [deepmind/gopher](https://huggingface.co/deepmind/gopher)
29
+ * [microsoft/megatron-turing-nlg](https://huggingface.co/microsoft/megatron-turing-nlg)
30
+
31
+ ## 🧩 Configuration
32
+
33
+ ```yaml
34
+ slices:
35
+ - sources:
36
+ - model: SuperAGI/SAM
37
+ layer_range: [0, 32]
38
+ - model: GoogleAI/Gemini
39
+ layer_range: [0, 32]
40
+ - model: bigscience/bloom
41
+ layer_range: [0, 32]
42
+ - model: openai/opt-175b
43
+ layer_range: [0, 32]
44
+ - model: deepmind/gopher
45
+ layer_range: [0, 32]
46
+ - model: microsoft/megatron-turing-nlg
47
+ layer_range: [0, 32]
48
+ merge_method: slerp
49
+ base_model: SuperAGI/SAM
50
+ parameters:
51
+ t:
52
+ - filter: self_attn
53
+ value: [0, 0.5, 0.3, 0.7, 1]
54
+ - filter: mlp
55
+ value: [1, 0.5, 0.7, 0.3, 0]
56
+ - value: 0.5
57
+ dtype: bfloat1
58
+ ```
59
+
60
+ ## 💻 Usage
61
+
62
+ ```python
63
+ !pip install -qU transformers accelerate
64
+
65
+ from transformers import AutoTokenizer
66
+ import transformers
67
+ import torch
68
+
69
+ model = "Or4cl3-1/SAM-Gemini-BLOOM-OPT-Gopher-Megatron-slerp"
70
+ messages = [{"role": "user", "content": "What is a large language model?"}]
71
+
72
+ tokenizer = AutoTokenizer.from_pretrained(model)
73
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
74
+ pipeline = transformers.pipeline(
75
+ "text-generation",
76
+ model=model,
77
+ torch_dtype=torch.float16,
78
+ device_map="auto",
79
+ )
80
+
81
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
82
+ print(outputs[0]["generated_text"])
83
+ ```