gagan3012 commited on
Commit
2098b2a
1 Parent(s): e97afe3

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +59 -0
  2. config.json +30 -0
README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ {}
3
+ ---
4
+ ---
5
+ license: apache-2.0
6
+ tags:
7
+ - moe
8
+ - mergekit
9
+ - merge
10
+ - gagan3012/MetaModel
11
+ - jeonsworld/CarbonVillain-en-10.7B-v2
12
+ - jeonsworld/CarbonVillain-en-10.7B-v4
13
+ - TomGrc/FusionNet_linear
14
+ ---
15
+
16
+ # MetaModel_moe_multilingualv1
17
+
18
+ This model is a Mixure of Experts (MoE) made with [mergekit](https://github.com/cg123/mergekit) (mixtral branch). It uses the following base models:
19
+ * [gagan3012/MetaModel](https://huggingface.co/gagan3012/MetaModel)
20
+ * [jeonsworld/CarbonVillain-en-10.7B-v2](https://huggingface.co/jeonsworld/CarbonVillain-en-10.7B-v2)
21
+ * [jeonsworld/CarbonVillain-en-10.7B-v4](https://huggingface.co/jeonsworld/CarbonVillain-en-10.7B-v4)
22
+ * [TomGrc/FusionNet_linear](https://huggingface.co/TomGrc/FusionNet_linear)
23
+
24
+ ## 🧩 Configuration
25
+
26
+ ```yaml
27
+ base_model: gagan3012/MetaModel
28
+ gate_mode: hidden
29
+ dtype: bfloat16
30
+ experts:
31
+ - source_model: gagan3012/MetaModel
32
+ - source_model: jeonsworld/CarbonVillain-en-10.7B-v2
33
+ - source_model: jeonsworld/CarbonVillain-en-10.7B-v4
34
+ - source_model: TomGrc/FusionNet_linear
35
+ ```
36
+
37
+ ## 💻 Usage
38
+
39
+ ```python
40
+ !pip install -qU transformers bitsandbytes accelerate
41
+
42
+ from transformers import AutoTokenizer
43
+ import transformers
44
+ import torch
45
+
46
+ model = "gagan3012/MetaModel_moe_multilingualv1"
47
+
48
+ tokenizer = AutoTokenizer.from_pretrained(model)
49
+ pipeline = transformers.pipeline(
50
+ "text-generation",
51
+ model=model,
52
+ model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
53
+ )
54
+
55
+ messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
56
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
57
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
58
+ print(outputs[0]["generated_text"])
59
+ ```
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "mlabonne/Marcoro14-7B-slerp",
3
+ "architectures": [
4
+ "MixtralForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 4096,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 14336,
13
+ "max_position_embeddings": 32768,
14
+ "model_type": "mixtral",
15
+ "num_attention_heads": 32,
16
+ "num_experts_per_tok": 2,
17
+ "num_hidden_layers": 32,
18
+ "num_key_value_heads": 8,
19
+ "num_local_experts": 8,
20
+ "output_router_logits": false,
21
+ "rms_norm_eps": 1e-05,
22
+ "rope_theta": 10000.0,
23
+ "router_aux_loss_coef": 0.001,
24
+ "sliding_window": null,
25
+ "tie_word_embeddings": false,
26
+ "torch_dtype": "bfloat16",
27
+ "transformers_version": "4.36.2",
28
+ "use_cache": true,
29
+ "vocab_size": 32000
30
+ }