初始化项目,由ModelHub XC社区提供模型
Model: jtatman/TinyDolphin-3x-MoE Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
80
README.md
Normal file
80
README.md
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
tags:
|
||||||
|
- moe
|
||||||
|
- frankenmoe
|
||||||
|
- merge
|
||||||
|
- mergekit
|
||||||
|
- lazymergekit
|
||||||
|
- cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
|
||||||
|
base_model:
|
||||||
|
- cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
- cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
- cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
---
|
||||||
|
|
||||||
|
# TinyDolphin-3x-MoE
|
||||||
|
|
||||||
|
TinyDolphin-3x-MoE is a Mixure of Experts (MoE) made with the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
||||||
|
* [cognitivecomputations/TinyDolphin-2.8.1-1.1b](https://huggingface.co/cognitivecomputations/TinyDolphin-2.8.1-1.1b)
|
||||||
|
* [cognitivecomputations/TinyDolphin-2.8.1-1.1b](https://huggingface.co/cognitivecomputations/TinyDolphin-2.8.1-1.1b)
|
||||||
|
* [cognitivecomputations/TinyDolphin-2.8.1-1.1b](https://huggingface.co/cognitivecomputations/TinyDolphin-2.8.1-1.1b)
|
||||||
|
|
||||||
|
## 🧩 Configuration
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
base_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
gate_mode: hidden
|
||||||
|
dtype: float16
|
||||||
|
experts:
|
||||||
|
- source_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
positive_prompts:
|
||||||
|
- "think step-by-step and follow these instructions"
|
||||||
|
- "read the following passage, and summarize it in less than 30 words."
|
||||||
|
- "please answer this question, consider the options carefully, and return the most likely answer."
|
||||||
|
- source_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
positive_prompts: ["produce python code"]
|
||||||
|
- source_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
positive_prompts: ["What is 2 x 22?"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## 💻 Usage
|
||||||
|
|
||||||
|
```python
|
||||||
|
!pip install -qU transformers bitsandbytes accelerate
|
||||||
|
|
||||||
|
from transformers import AutoTokenizer
|
||||||
|
import transformers
|
||||||
|
import torch
|
||||||
|
|
||||||
|
model = "jtatman/TinyDolphin-3x-MoE"
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model)
|
||||||
|
pipeline = transformers.pipeline(
|
||||||
|
"text-generation",
|
||||||
|
model=model,
|
||||||
|
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
|
||||||
|
)
|
||||||
|
|
||||||
|
messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
|
||||||
|
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
||||||
|
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
||||||
|
print(outputs[0]["generated_text"])
|
||||||
|
```
|
||||||
|
|
||||||
|
Eval:
|
||||||
|
|
||||||
|
hf ({'pretrained': 'jtatman/TinyDolphin-3x-MoE'}), gen_kwargs: ({}), limit: None, num_fewshot: 0, batch_size: auto (64)
|
||||||
|
| Tasks |Version|Filter|n-shot| Metric | |Value | |Stderr|
|
||||||
|
|-------------|------:|------|-----:|--------|---|-----:|---|-----:|
|
||||||
|
|arc_challenge| 1|none | 0|acc |↑ |0.3063|± |0.0135|
|
||||||
|
| | |none | 0|acc_norm|↑ |0.3285|± |0.0137|
|
||||||
|
|arc_easy | 1|none | 0|acc |↑ |0.5981|± |0.0101|
|
||||||
|
| | |none | 0|acc_norm|↑ |0.5467|± |0.0102|
|
||||||
|
|hellaswag | 1|none | 0|acc |↑ |0.4656|± |0.0050|
|
||||||
|
| | |none | 0|acc_norm|↑ |0.6004|± |0.0049|
|
||||||
|
|openbookqa | 1|none | 0|acc |↑ |0.2300|± |0.0188|
|
||||||
|
| | |none | 0|acc_norm|↑ |0.3640|± |0.0215|
|
||||||
|
|piqa | 1|none | 0|acc |↑ |0.7318|± |0.0103|
|
||||||
|
| | |none | 0|acc_norm|↑ |0.7296|± |0.0104|
|
||||||
4
added_tokens.json
Normal file
4
added_tokens.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"<|im_end|>": 32000,
|
||||||
|
"<|im_start|>": 32001
|
||||||
|
}
|
||||||
33
config.json
Normal file
33
config.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "cognitivecomputations/TinyDolphin-2.8.1-1.1b",
|
||||||
|
"architectures": [
|
||||||
|
"MixtralForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 32000,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 2048,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 5632,
|
||||||
|
"max_position_embeddings": 4096,
|
||||||
|
"model_type": "mixtral",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_experts_per_tok": 2,
|
||||||
|
"num_hidden_layers": 22,
|
||||||
|
"num_key_value_heads": 4,
|
||||||
|
"num_local_experts": 3,
|
||||||
|
"output_router_logits": false,
|
||||||
|
"pretraining_tp": 1,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_scaling": null,
|
||||||
|
"rope_theta": 10000.0,
|
||||||
|
"router_aux_loss_coef": 0.001,
|
||||||
|
"sliding_window": null,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"torch_dtype": "float16",
|
||||||
|
"transformers_version": "4.37.2",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 32002
|
||||||
|
}
|
||||||
14
mergekit_moe_config.yml
Normal file
14
mergekit_moe_config.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
base_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
gate_mode: hidden
|
||||||
|
dtype: float16
|
||||||
|
experts:
|
||||||
|
- source_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
positive_prompts:
|
||||||
|
- "think step-by-step and follow these instructions"
|
||||||
|
- "read the following passage, and summarize it in less than 30 words."
|
||||||
|
- "please answer this question, consider the options carefully, and return the most likely answer."
|
||||||
|
- source_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
positive_prompts: ["produce python code"]
|
||||||
|
- source_model: cognitivecomputations/TinyDolphin-2.8.1-1.1b
|
||||||
|
positive_prompts: ["What is 2 x 22?"]
|
||||||
3
model-00001-of-00003.safetensors
Normal file
3
model-00001-of-00003.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:510d9daabf8eb016eaa0d5283d65b3bdedaef51f9a95b3a0cae4f4e6a0dc3231
|
||||||
|
size 1992417376
|
||||||
3
model-00002-of-00003.safetensors
Normal file
3
model-00002-of-00003.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:fb39e56d2f8953cb8c7269e0dbb3edb49f656d6c1a12e0d6f585fb1873c632ed
|
||||||
|
size 1983916864
|
||||||
3
model-00003-of-00003.safetensors
Normal file
3
model-00003-of-00003.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:439104e9a95b94de573eec1aba7fa8c0f466c0e0dbaaef24d8a818a953e94006
|
||||||
|
size 1269157440
|
||||||
1
model.safetensors.index.json
Normal file
1
model.safetensors.index.json
Normal file
File diff suppressed because one or more lines are too long
24
special_tokens_map.json
Normal file
24
special_tokens_map.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "<|im_end|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": "<s>",
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
93416
tokenizer.json
Normal file
93416
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
Binary file not shown.
60
tokenizer_config.json
Normal file
60
tokenizer_config.json
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"add_bos_token": true,
|
||||||
|
"add_eos_token": false,
|
||||||
|
"added_tokens_decoder": {
|
||||||
|
"0": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"1": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"32000": {
|
||||||
|
"content": "<|im_end|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"32001": {
|
||||||
|
"content": "<|im_start|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bos_token": "<s>",
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": "<|im_end|>",
|
||||||
|
"legacy": false,
|
||||||
|
"model_max_length": 1000000000000000019884624838656,
|
||||||
|
"pad_token": "<s>",
|
||||||
|
"padding_side": "left",
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"spaces_between_special_tokens": false,
|
||||||
|
"tokenizer_class": "LlamaTokenizer",
|
||||||
|
"trust_remote_code": false,
|
||||||
|
"unk_token": "<unk>",
|
||||||
|
"use_default_system_prompt": false,
|
||||||
|
"use_fast": true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user