Upload folder using huggingface_hub
Browse files- README.md +72 -0
- config.json +30 -0
- model-1.safetensors +3 -0
- model-2.safetensors +3 -0
- model-3.safetensors +3 -0
- model-4.safetensors +3 -0
README.md
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- moe
|
5 |
+
- mixtral
|
6 |
+
- gagan3012/Mistral_arabic_dpo
|
7 |
+
- davidkim205/komt-mistral-7b-v1
|
8 |
+
- OpenBuddy/openbuddy-zephyr-7b-v14.1
|
9 |
+
- manishiitg/open-aditi-hi-v1
|
10 |
+
---
|
11 |
+
|
12 |
+
# Multilingual-mistral-asian
|
13 |
+
|
14 |
+
This model is a Mixure of Experts (MoE) made with [mergekit](https://github.com/cg123/mergekit) (mixtral branch). It uses the following base models:
|
15 |
+
* [gagan3012/Mistral_arabic_dpo](https://huggingface.co/gagan3012/Mistral_arabic_dpo)
|
16 |
+
* [davidkim205/komt-mistral-7b-v1](https://huggingface.co/davidkim205/komt-mistral-7b-v1)
|
17 |
+
* [OpenBuddy/openbuddy-zephyr-7b-v14.1](https://huggingface.co/OpenBuddy/openbuddy-zephyr-7b-v14.1)
|
18 |
+
* [manishiitg/open-aditi-hi-v1](https://huggingface.co/manishiitg/open-aditi-hi-v1)
|
19 |
+
|
20 |
+
## 🧩 Configuration
|
21 |
+
|
22 |
+
```yamlbase_model: mistralai/Mistral-7B-Instruct-v0.2
|
23 |
+
dtype: bfloat16
|
24 |
+
experts:
|
25 |
+
- positive_prompts:
|
26 |
+
- arabic
|
27 |
+
- arab
|
28 |
+
- arabia
|
29 |
+
- answer in arabic
|
30 |
+
source_model: gagan3012/Mistral_arabic_dpo
|
31 |
+
- positive_prompts:
|
32 |
+
- korean
|
33 |
+
- answer in korean
|
34 |
+
- korea
|
35 |
+
source_model: davidkim205/komt-mistral-7b-v1
|
36 |
+
- positive_prompts:
|
37 |
+
- chinese
|
38 |
+
- china
|
39 |
+
- answer in chinese
|
40 |
+
source_model: OpenBuddy/openbuddy-zephyr-7b-v14.1
|
41 |
+
- positive_prompts:
|
42 |
+
- hindi
|
43 |
+
- india
|
44 |
+
- hindu
|
45 |
+
- answer in hindi
|
46 |
+
source_model: manishiitg/open-aditi-hi-v1
|
47 |
+
gate_mode: hidden
|
48 |
+
```
|
49 |
+
|
50 |
+
## 💻 Usage
|
51 |
+
|
52 |
+
```python
|
53 |
+
!pip install -qU transformers bitsandbytes accelerate
|
54 |
+
|
55 |
+
from transformers import AutoTokenizer
|
56 |
+
import transformers
|
57 |
+
import torch
|
58 |
+
|
59 |
+
model = "gagan3012/Multilingual-mistral-asian"
|
60 |
+
|
61 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
62 |
+
pipeline = transformers.pipeline(
|
63 |
+
"text-generation",
|
64 |
+
model=model,
|
65 |
+
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
|
66 |
+
)
|
67 |
+
|
68 |
+
messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
|
69 |
+
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
70 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
71 |
+
print(outputs[0]["generated_text"])
|
72 |
+
```
|
config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "mistralai/Mistral-7B-Instruct-v0.2",
|
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": 4,
|
20 |
+
"output_router_logits": false,
|
21 |
+
"rms_norm_eps": 1e-05,
|
22 |
+
"rope_theta": 1000000.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 |
+
}
|
model-1.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b1ab1e84474c0d342c2df483137067e03138fc207460463551daf2d3329e4018
|
3 |
+
size 9919813704
|
model-2.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:acb360354ac66a9dad0e3736f0a59df4565b93debf6ae799c657f160c0c8448a
|
3 |
+
size 9982454720
|
model-3.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eab6fac246c7d7efa46599dd5cc0352efa86af38906c2b12a44600c53909f2f8
|
3 |
+
size 9982454752
|
model-4.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ac63e34c632f9d04d0de500c71735db22bebb560cc7cff58f32420d5ceb851af
|
3 |
+
size 9982454720
|