allknowingroger commited on
Commit
1f5d132
1 Parent(s): 411feca

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - moe
5
+ - frankenmoe
6
+ - merge
7
+ - mergekit
8
+ - lazymergekit
9
+ - johnsnowlabs/JSL-MedLlama-3-8B-v1.0
10
+ - Weyaxi/Einstein-v6.1-Llama3-8B
11
+ base_model:
12
+ - johnsnowlabs/JSL-MedLlama-3-8B-v1.0
13
+ - Weyaxi/Einstein-v6.1-Llama3-8B
14
+ ---
15
+
16
+ # Llama3medical-15B-MoE
17
+
18
+ Llama3medical-15B-MoE is a Mixture of Experts (MoE) made with the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
19
+ * [johnsnowlabs/JSL-MedLlama-3-8B-v1.0](https://huggingface.co/johnsnowlabs/JSL-MedLlama-3-8B-v1.0)
20
+ * [Weyaxi/Einstein-v6.1-Llama3-8B](https://huggingface.co/Weyaxi/Einstein-v6.1-Llama3-8B)
21
+
22
+ ## 🧩 Configuration
23
+
24
+ ```yaml
25
+ base_model: johnsnowlabs/JSL-MedLlama-3-8B-v1.0
26
+ experts:
27
+ - source_model: johnsnowlabs/JSL-MedLlama-3-8B-v1.0
28
+ positive_prompts: ["medical"]
29
+ - source_model: Weyaxi/Einstein-v6.1-Llama3-8B
30
+ positive_prompts: ["what"]
31
+ ```
32
+
33
+ ## 💻 Usage
34
+
35
+ ```python
36
+ !pip install -qU transformers bitsandbytes accelerate
37
+
38
+ from transformers import AutoTokenizer
39
+ import transformers
40
+ import torch
41
+
42
+ model = "allknowingroger/Llama3medical-15B-MoE"
43
+
44
+ tokenizer = AutoTokenizer.from_pretrained(model)
45
+ pipeline = transformers.pipeline(
46
+ "text-generation",
47
+ model=model,
48
+ model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
49
+ )
50
+
51
+ messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
52
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
53
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
54
+ print(outputs[0]["generated_text"])
55
+ ```
config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "johnsnowlabs/JSL-MedLlama-3-8B-v1.0",
3
+ "architectures": [
4
+ "MixtralForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 128000,
9
+ "eos_token_id": 128001,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 4096,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 14336,
14
+ "max_position_embeddings": 8192,
15
+ "model_type": "mixtral",
16
+ "num_attention_heads": 32,
17
+ "num_experts_per_tok": 2,
18
+ "num_hidden_layers": 32,
19
+ "num_key_value_heads": 8,
20
+ "num_local_experts": 2,
21
+ "output_router_logits": false,
22
+ "pretraining_tp": 1,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_scaling": null,
25
+ "rope_theta": 500000.0,
26
+ "router_aux_loss_coef": 0.001,
27
+ "router_jitter_noise": 0.0,
28
+ "sliding_window": null,
29
+ "tie_word_embeddings": false,
30
+ "torch_dtype": "float16",
31
+ "transformers_version": "4.40.1",
32
+ "use_cache": true,
33
+ "vocab_size": 128256
34
+ }
model-1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:78b612eb12fe39d08eb404c44f8d4b997522040a428d9409de4e56c577ad850a
3
+ size 1050681576
model-10.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31a436fc9b004138ce2b726537fe12b654609d07285bf285162415eac015c0f0
3
+ size 1996490936
model-11.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac6e2261de96fc841c1ece11abb4fae63d31e1dde6af5710a97d40994e28fa23
3
+ size 1996490944
model-12.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:905d40c9809896d8bfc10458d3aeb239fdba88fcbf05dc7fc4b07d4d8a594050
3
+ size 1996490952
model-13.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70a7fe98026fa29925f6c83b6058a11a9efffbbef962deb9d907c740d41a58a2
3
+ size 1979980392
model-14.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c1e4e3b71861b162ac66414863a9dd3c0e76d8fa82554b5b876d06742b3b487
3
+ size 1979723896
model-2.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ceef2b3ab6b0769f794e860feff0d0cfc024e4fe23527e8fedfc38fbe30a42b3
3
+ size 1990464104
model-3.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb9e623f76b1535aa8b264527515c91fd31562eb06e6c847df729b8d87a9f8b7
3
+ size 1996490936
model-4.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69755cb07a64c18c6721db00c323d91284e4e6da37c41d3d7d5f5b541b8a7eaf
3
+ size 1996490952
model-5.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11fef3834fa85aefdee9cf521b2f5edae6f13347c2e04dcaf4eec9afd1b958a1
3
+ size 1996490952
model-6.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a71f4506a1abcbcff6db9f97aaec55300ce2be1c04c069b387d93243dca207c
3
+ size 1996490936
model-7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38cc8e097e4feb45a258ab0f787f8412dae87cfcf5b85c8ca51d4cb0594506d0
3
+ size 1996490944
model-8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:415d361719a7eff9437a2ab34261546ae7c099a656a853a8ea79cec5db373ea1
3
+ size 1996490952
model-9.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a5723c41b0c1c234e0b6f022bf1b58249b1accca1e32a5e7570e45915fde8f7
3
+ size 1996490952