初始化项目,由ModelHub XC社区提供模型
Model: Technoculture/Medorca-4x7b 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
|
||||||
105
README.md
Normal file
105
README.md
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
tags:
|
||||||
|
- moe
|
||||||
|
- merge
|
||||||
|
- epfl-llm/meditron-7b
|
||||||
|
- medalpaca/medalpaca-7b
|
||||||
|
- chaoyi-wu/PMC_LLAMA_7B_10_epoch
|
||||||
|
- microsoft/Orca-2-7b
|
||||||
|
---
|
||||||
|
|
||||||
|
# Medorca-4x7b
|
||||||
|
|
||||||
|
Mediquad-orca-20B is a Mixure of Experts (MoE) made with the following models:
|
||||||
|
* [epfl-llm/meditron-7b](https://huggingface.co/epfl-llm/meditron-7b)
|
||||||
|
* [medalpaca/medalpaca-7b](https://huggingface.co/medalpaca/medalpaca-7b)
|
||||||
|
* [chaoyi-wu/PMC_LLAMA_7B_10_epoch](https://huggingface.co/chaoyi-wu/PMC_LLAMA_7B_10_epoch)
|
||||||
|
* [microsoft/Orca-2-7b](https://huggingface.co/microsoft/Orca-2-7b)
|
||||||
|
|
||||||
|
## Evaluations
|
||||||
|
|
||||||
|
[open_llm_leaderboard](https://huggingface.co/datasets/open-llm-leaderboard/details_Technoculture__Mediquad-orca-20B)
|
||||||
|
|
||||||
|
| Benchmark | Medorca-4x7b | Orca-2-7b | meditron-7b | meditron-70b |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| MedMCQA | | | | |
|
||||||
|
| ClosedPubMedQA | | | | |
|
||||||
|
| PubMedQA | | | | |
|
||||||
|
| MedQA | | | | |
|
||||||
|
| MedQA4 | | | | |
|
||||||
|
| MedicationQA | | | | |
|
||||||
|
| MMLU Medical | | | | |
|
||||||
|
| MMLU | 24.28 | 56.37 | | |
|
||||||
|
| TruthfulQA | 48.42 | 52.45 | | |
|
||||||
|
| GSM8K | 0 | 47.2 | | |
|
||||||
|
| ARC | 29.35 | 54.1 | | |
|
||||||
|
| HellaSwag | 25.72 | 76.19 | | |
|
||||||
|
| Winogrande | 48.3 | 73.48 | | |
|
||||||
|
|
||||||
|
## 🧩 Configuration
|
||||||
|
|
||||||
|
```yamlbase_model: microsoft/Orca-2-7b
|
||||||
|
gate_mode: hidden
|
||||||
|
dtype: bfloat16
|
||||||
|
experts:
|
||||||
|
- source_model: epfl-llm/meditron-7b
|
||||||
|
positive_prompts:
|
||||||
|
- "How does sleep affect cardiovascular health?"
|
||||||
|
- "When discussing diabetes management, the key factors to consider are"
|
||||||
|
- "The differential diagnosis for a headache with visual aura could include"
|
||||||
|
negative_prompts:
|
||||||
|
- "What are the environmental impacts of deforestation?"
|
||||||
|
- "The recent advancements in artificial intelligence have led to developments in"
|
||||||
|
- source_model: medalpaca/medalpaca-7b
|
||||||
|
positive_prompts:
|
||||||
|
- "When discussing diabetes management, the key factors to consider are"
|
||||||
|
- "The differential diagnosis for a headache with visual aura could include"
|
||||||
|
negative_prompts:
|
||||||
|
- "Recommend a good recipe for a vegetarian lasagna."
|
||||||
|
- "The fundamental concepts in economics include ideas like supply and demand, which explain"
|
||||||
|
- source_model: chaoyi-wu/PMC_LLAMA_7B_10_epoch
|
||||||
|
positive_prompts:
|
||||||
|
- "How does sleep affect cardiovascular health?"
|
||||||
|
- "When discussing diabetes management, the key factors to consider are"
|
||||||
|
negative_prompts:
|
||||||
|
- "Recommend a good recipe for a vegetarian lasagna."
|
||||||
|
- "The recent advancements in artificial intelligence have led to developments in"
|
||||||
|
- "The fundamental concepts in economics include ideas like supply and demand, which explain"
|
||||||
|
- source_model: microsoft/Orca-2-7b
|
||||||
|
positive_prompts:
|
||||||
|
- "Here is a funny joke for you -"
|
||||||
|
- "When considering the ethical implications of artificial intelligence, one must take into account"
|
||||||
|
- "In strategic planning, a company must analyze its strengths and weaknesses, which involves"
|
||||||
|
- "Understanding consumer behavior in marketing requires considering factors like"
|
||||||
|
- "The debate on climate change solutions hinges on arguments that"
|
||||||
|
negative_prompts:
|
||||||
|
- "In discussing dietary adjustments for managing hypertension, it's crucial to emphasize"
|
||||||
|
- "For early detection of melanoma, dermatologists recommend that patients regularly check their skin for"
|
||||||
|
- "Explaining the importance of vaccination, a healthcare professional should highlight"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## 💻 Usage
|
||||||
|
|
||||||
|
```python
|
||||||
|
!pip install -qU transformers bitsandbytes accelerate
|
||||||
|
|
||||||
|
from transformers import AutoTokenizer
|
||||||
|
import transformers
|
||||||
|
import torch
|
||||||
|
|
||||||
|
model = "Technoculture/Mediquad-orca-20B"
|
||||||
|
|
||||||
|
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"])
|
||||||
|
```
|
||||||
5
added_tokens.json
Normal file
5
added_tokens.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"<|im_end|>": 32002,
|
||||||
|
"<|im_start|>": 32001,
|
||||||
|
"[PAD]": 32000
|
||||||
|
}
|
||||||
33
config.json
Normal file
33
config.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "microsoft/Orca-2-7b",
|
||||||
|
"architectures": [
|
||||||
|
"MixtralForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 4096,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 11008,
|
||||||
|
"max_position_embeddings": 4096,
|
||||||
|
"model_type": "mixtral",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_experts_per_tok": 2,
|
||||||
|
"num_hidden_layers": 32,
|
||||||
|
"num_key_value_heads": 32,
|
||||||
|
"num_local_experts": 4,
|
||||||
|
"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": "float32",
|
||||||
|
"transformers_version": "4.37.0.dev0",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 32003
|
||||||
|
}
|
||||||
39
mergekit_moe_config.yml
Normal file
39
mergekit_moe_config.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
base_model: microsoft/Orca-2-7b
|
||||||
|
gate_mode: hidden
|
||||||
|
dtype: bfloat16
|
||||||
|
experts:
|
||||||
|
- source_model: epfl-llm/meditron-7b
|
||||||
|
positive_prompts:
|
||||||
|
- "How does sleep affect cardiovascular health?"
|
||||||
|
- "When discussing diabetes management, the key factors to consider are"
|
||||||
|
- "The differential diagnosis for a headache with visual aura could include"
|
||||||
|
negative_prompts:
|
||||||
|
- "What are the environmental impacts of deforestation?"
|
||||||
|
- "The recent advancements in artificial intelligence have led to developments in"
|
||||||
|
- source_model: medalpaca/medalpaca-7b
|
||||||
|
positive_prompts:
|
||||||
|
- "When discussing diabetes management, the key factors to consider are"
|
||||||
|
- "The differential diagnosis for a headache with visual aura could include"
|
||||||
|
negative_prompts:
|
||||||
|
- "Recommend a good recipe for a vegetarian lasagna."
|
||||||
|
- "The fundamental concepts in economics include ideas like supply and demand, which explain"
|
||||||
|
- source_model: chaoyi-wu/PMC_LLAMA_7B_10_epoch
|
||||||
|
positive_prompts:
|
||||||
|
- "How does sleep affect cardiovascular health?"
|
||||||
|
- "When discussing diabetes management, the key factors to consider are"
|
||||||
|
negative_prompts:
|
||||||
|
- "Recommend a good recipe for a vegetarian lasagna."
|
||||||
|
- "The recent advancements in artificial intelligence have led to developments in"
|
||||||
|
- "The fundamental concepts in economics include ideas like supply and demand, which explain"
|
||||||
|
- source_model: microsoft/Orca-2-7b
|
||||||
|
positive_prompts:
|
||||||
|
- "Here is a funny joke for you -"
|
||||||
|
- "When considering the ethical implications of artificial intelligence, one must take into account"
|
||||||
|
- "In strategic planning, a company must analyze its strengths and weaknesses, which involves"
|
||||||
|
- "Understanding consumer behavior in marketing requires considering factors like"
|
||||||
|
- "The debate on climate change solutions hinges on arguments that"
|
||||||
|
negative_prompts:
|
||||||
|
- "In discussing dietary adjustments for managing hypertension, it's crucial to emphasize"
|
||||||
|
- "For early detection of melanoma, dermatologists recommend that patients regularly check their skin for"
|
||||||
|
- "Explaining the importance of vaccination, a healthcare professional should highlight"
|
||||||
|
|
||||||
3
model-00001-of-00004.safetensors
Normal file
3
model-00001-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a1f59b248971d125989319046615aef043f3bcb1dd0dbf4984138b2779efceaa
|
||||||
|
size 9993266472
|
||||||
3
model-00002-of-00004.safetensors
Normal file
3
model-00002-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:881493d1b106793249884c7af0be9fe8e8a4360a6673d3a0a1a26b6373ccd6cd
|
||||||
|
size 9919543448
|
||||||
3
model-00003-of-00004.safetensors
Normal file
3
model-00003-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:578fdcf3814c0ee78557a993d28835860e22cd596c1f4dfc5adec1471976c3ec
|
||||||
|
size 9919543448
|
||||||
3
model-00004-of-00004.safetensors
Normal file
3
model-00004-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a63fe2b156b56d8fa47e436097222339296952ae9f3eb8818b1a209deb600bc7
|
||||||
|
size 9616783112
|
||||||
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": "</s>",
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
93425
tokenizer.json
Normal file
93425
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.
66
tokenizer_config.json
Normal file
66
tokenizer_config.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"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": "[PAD]",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"32001": {
|
||||||
|
"content": "<|im_start|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": false
|
||||||
|
},
|
||||||
|
"32002": {
|
||||||
|
"content": "<|im_end|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bos_token": "<s>",
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": "</s>",
|
||||||
|
"legacy": false,
|
||||||
|
"model_max_length": 4096,
|
||||||
|
"pad_token": "<s>",
|
||||||
|
"padding_side": "left",
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"spaces_between_special_tokens": false,
|
||||||
|
"tokenizer_class": "LlamaTokenizer",
|
||||||
|
"unk_token": "<unk>",
|
||||||
|
"use_default_system_prompt": true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user