初始化项目,由ModelHub XC社区提供模型
Model: RedHatAI/Llama-2-7b-dolphin-open_platypus-pruned_50 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
|
||||
69
README.md
Normal file
69
README.md
Normal file
@@ -0,0 +1,69 @@
|
||||
---
|
||||
base_model: neuralmagic/Llama-2-7b-pruned50-retrained
|
||||
inference: true
|
||||
model_type: llama
|
||||
pipeline_tag: text-generation
|
||||
datasets:
|
||||
- garage-bAInd/Open-Platypus
|
||||
- Open-Orca/OpenOrca
|
||||
- cognitivecomputations/dolphin
|
||||
tags:
|
||||
- sparse
|
||||
- instruct
|
||||
---
|
||||
|
||||
# Llama-2-7b-pruned50-retrained-instruct
|
||||
|
||||
This repo contains a [50% sparse Llama 2 7B](https://huggingface.co/neuralmagic/Llama-2-7b-pruned50-retrained) finetuned for instruction-following tasks using a blend of the Platypus + Open Orca + Dolphin datasets.
|
||||
|
||||
Official model weights from [Enabling High-Sparsity Foundational Llama Models with Efficient Pretraining and Deployment](https://arxiv.org/abs/2405.03594).
|
||||
|
||||
**Authors**: Neural Magic, Cerebras
|
||||
|
||||
## Usage
|
||||
|
||||
Below we share some code snippets on how to get quickly started with running the model.
|
||||
|
||||
### Sparse Transfer
|
||||
|
||||
By leveraging a pre-sparsified model's structure, you can efficiently fine-tune on new data, leading to reduced hyperparameter tuning, training times, and computational costs. Learn about this process [here](https://neuralmagic.github.io/docs-v2/get-started/transfer).
|
||||
|
||||
### Running the model
|
||||
|
||||
This model may be run with the transformers library. For accelerated inference with sparsity, deploy with [nm-vllm](https://github.com/neuralmagic/nm-vllm) or [deepsparse](https://github.com/neuralmagic/deepsparse).
|
||||
|
||||
```python
|
||||
# pip install transformers accelerate
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||
|
||||
tokenizer = AutoTokenizer.from_pretrained("Llama-2-7b-pruned50-retrained-instruct")
|
||||
model = AutoModelForCausalLM.from_pretrained("Llama-2-7b-pruned50-retrained-instruct", device_map="auto")
|
||||
|
||||
input_text = "Write a recipe for banana bread:\n"
|
||||
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
||||
|
||||
outputs = model.generate(**input_ids)
|
||||
print(tokenizer.decode(outputs[0]))
|
||||
```
|
||||
|
||||
## Evaluation Benchmark Results
|
||||
|
||||
Model evaluation metrics and results.
|
||||
|
||||
| Benchmark | Metric | Llama-2-7b-instruct | Llama-2-7b-pruned50-retrained-instruct |
|
||||
|------------------------------------------------|---------------|-------------|-------------------------------|
|
||||
| [MMLU](https://arxiv.org/abs/2009.03300) | 5-shot | 48.60% | 45.10% |
|
||||
| [HellaSwag](https://arxiv.org/abs/1905.07830) | 10-shot | 79.45% | 78.86% |
|
||||
| [WinoGrande](https://arxiv.org/abs/1907.10641) | 5-shot | 75.69% | 72.61% |
|
||||
| [ARC-c](https://arxiv.org/abs/1911.01547) | 25-shot | 53.92% | 50.77% |
|
||||
| [TruthfulQA](https://arxiv.org/abs/2109.07958) | 0-shot | 43.63% | 44.40% |
|
||||
| [GSM8K](https://arxiv.org/abs/2110.14168) | 5-shot | 15.92% | 16.38% |
|
||||
|
||||
## Model Training Details
|
||||
|
||||
This model was obtained by sparse-tranfer of the sparse foundational model [Llama-2-7b-pruned50-retrained](https://huggingface.co/neuralmagic/Llama-2-7b-pruned70-retrained) on a blend of [Open Platypus](https://huggingface.co/datasets/garage-bAInd/Open-Platypus), 10% [Open Orca](https://huggingface.co/datasets/Open-Orca/OpenOrca) and 10% [Dolphin](https://huggingface.co/datasets/cognitivecomputations/dolphin) datasets.
|
||||
Training was perfomerd for 2 epochs.
|
||||
|
||||
## Help
|
||||
|
||||
For further support, and discussions on these models and AI in general, join [Neural Magic's Slack Community](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ)
|
||||
25
arc_challenge.json
Normal file
25
arc_challenge.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"results": {
|
||||
"arc_challenge": {
|
||||
"acc": 0.4803754266211604,
|
||||
"acc_stderr": 0.014600132075947094,
|
||||
"acc_norm": 0.5025597269624573,
|
||||
"acc_norm_stderr": 0.014611199329843784
|
||||
}
|
||||
},
|
||||
"versions": {
|
||||
"arc_challenge": 0
|
||||
},
|
||||
"config": {
|
||||
"model": "hf",
|
||||
"model_args": "pretrained=/nm/drive1/shubhra/cerebras/experiments/spft-cerebras_llama2_sparse50_45B_platypus_dolphin_KDFalse_GCTrue_LR1e-4_E2/combined/,trust_remote_code=True,dtype=bfloat16",
|
||||
"num_fewshot": 25,
|
||||
"batch_size": "32",
|
||||
"batch_sizes": [],
|
||||
"device": "cuda:0",
|
||||
"no_cache": true,
|
||||
"limit": null,
|
||||
"bootstrap_iters": 100000,
|
||||
"description_dict": {}
|
||||
}
|
||||
}
|
||||
29
config.json
Normal file
29
config.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"_name_or_path": "neuralmagic/Llama-2-7b-pruned50-retrained-instruct",
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"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": "llama",
|
||||
"num_attention_heads": 32,
|
||||
"num_hidden_layers": 32,
|
||||
"num_key_value_heads": 32,
|
||||
"pretraining_tp": 1,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_scaling": null,
|
||||
"rope_theta": 10000.0,
|
||||
"tie_word_embeddings": false,
|
||||
"tokenizer_class": "LlamaTokenizerFast",
|
||||
"torch_dtype": "bfloat16",
|
||||
"transformers_version": "1.7.0.43401",
|
||||
"use_cache": true,
|
||||
"vocab_size": 32000
|
||||
}
|
||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
||||
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": 2,
|
||||
"transformers_version": "1.7.0.43401"
|
||||
}
|
||||
23
gsm8k.json
Normal file
23
gsm8k.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"results": {
|
||||
"gsm8k": {
|
||||
"acc": 0.18119787717968158,
|
||||
"acc_stderr": 0.010609827611527357
|
||||
}
|
||||
},
|
||||
"versions": {
|
||||
"gsm8k": 0
|
||||
},
|
||||
"config": {
|
||||
"model": "hf",
|
||||
"model_args": "pretrained=/nm/drive1/shubhra/cerebras/experiments/spft-cerebras_llama2_sparse50_45B_platypus_dolphin_KDFalse_GCTrue_LR1e-4_E2/combined/,trust_remote_code=True,dtype=bfloat16",
|
||||
"num_fewshot": 5,
|
||||
"batch_size": "128",
|
||||
"batch_sizes": [],
|
||||
"device": "cuda:0",
|
||||
"no_cache": true,
|
||||
"limit": null,
|
||||
"bootstrap_iters": 100000,
|
||||
"description_dict": {}
|
||||
}
|
||||
}
|
||||
25
hellaswag.json
Normal file
25
hellaswag.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"results": {
|
||||
"hellaswag": {
|
||||
"acc": 0.5884285998805019,
|
||||
"acc_stderr": 0.004911125101064641,
|
||||
"acc_norm": 0.784106751643099,
|
||||
"acc_norm_stderr": 0.004105997149954853
|
||||
}
|
||||
},
|
||||
"versions": {
|
||||
"hellaswag": 0
|
||||
},
|
||||
"config": {
|
||||
"model": "hf",
|
||||
"model_args": "pretrained=/nm/drive1/shubhra/cerebras/experiments/spft-cerebras_llama2_sparse50_45B_platypus_dolphin_KDFalse_GCTrue_LR1e-4_E2/combined/,trust_remote_code=True,dtype=bfloat16",
|
||||
"num_fewshot": 10,
|
||||
"batch_size": "48",
|
||||
"batch_sizes": [],
|
||||
"device": "cuda:0",
|
||||
"no_cache": true,
|
||||
"limit": null,
|
||||
"bootstrap_iters": 100000,
|
||||
"description_dict": {}
|
||||
}
|
||||
}
|
||||
3
mmlu.json
Normal file
3
mmlu.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:79081a09fdf963d94f6f2d8c298c881cce9c960dff18d5445d75010797b31d9f
|
||||
size 14284
|
||||
3
model-00001-of-00002.safetensors
Normal file
3
model-00001-of-00002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:73199b4063a3f4be2036cf071a933f467efe61d8f03cb275d49d7c4b368d305f
|
||||
size 9976570520
|
||||
3
model-00002-of-00002.safetensors
Normal file
3
model-00002-of-00002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9544c229cb5f32b0ed0b14e11f0db472cc84ce95207551476621337009861ceb
|
||||
size 3500294544
|
||||
3
model.safetensors.index.json
Normal file
3
model.safetensors.index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:610194b49eade5f9d8ff8702c373fdd515269847f6d36425355ed1c2fd31f348
|
||||
size 23950
|
||||
23
special_tokens_map.json
Normal file
23
special_tokens_map.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"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
|
||||
},
|
||||
"unk_token": {
|
||||
"content": "<unk>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
BIN
tokenizer.json
(Stored with Git LFS)
Normal file
BIN
tokenizer.json
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
Binary file not shown.
41
tokenizer_config.json
Normal file
41
tokenizer_config.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
},
|
||||
"bos_token": "<s>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "</s>",
|
||||
"legacy": false,
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"pad_token": null,
|
||||
"padding_side": "right",
|
||||
"sp_model_kwargs": {},
|
||||
"tokenizer_class": "LlamaTokenizer",
|
||||
"unk_token": "<unk>",
|
||||
"use_default_system_prompt": false
|
||||
}
|
||||
25
truthfulqa_mc.json
Normal file
25
truthfulqa_mc.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"results": {
|
||||
"truthfulqa_mc": {
|
||||
"mc1": 0.2839657282741738,
|
||||
"mc1_stderr": 0.015785370858396725,
|
||||
"mc2": 0.4316910007581044,
|
||||
"mc2_stderr": 0.014766457929501058
|
||||
}
|
||||
},
|
||||
"versions": {
|
||||
"truthfulqa_mc": 1
|
||||
},
|
||||
"config": {
|
||||
"model": "hf",
|
||||
"model_args": "pretrained=/nm/drive1/shubhra/cerebras/experiments/spft-cerebras_llama2_sparse50_45B_platypus_dolphin_KDFalse_GCTrue_LR1e-4_E2/combined/,trust_remote_code=True,dtype=bfloat16",
|
||||
"num_fewshot": 0,
|
||||
"batch_size": "128",
|
||||
"batch_sizes": [],
|
||||
"device": "cuda:0",
|
||||
"no_cache": true,
|
||||
"limit": null,
|
||||
"bootstrap_iters": 100000,
|
||||
"description_dict": {}
|
||||
}
|
||||
}
|
||||
23
winogrande.json
Normal file
23
winogrande.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"results": {
|
||||
"winogrande": {
|
||||
"acc": 0.7324388318863457,
|
||||
"acc_stderr": 0.012441718456893009
|
||||
}
|
||||
},
|
||||
"versions": {
|
||||
"winogrande": 0
|
||||
},
|
||||
"config": {
|
||||
"model": "hf",
|
||||
"model_args": "pretrained=/nm/drive1/shubhra/cerebras/experiments/spft-cerebras_llama2_sparse50_45B_platypus_dolphin_KDFalse_GCTrue_LR1e-4_E2/combined/,trust_remote_code=True,dtype=bfloat16",
|
||||
"num_fewshot": 5,
|
||||
"batch_size": "128",
|
||||
"batch_sizes": [],
|
||||
"device": "cuda:0",
|
||||
"no_cache": true,
|
||||
"limit": null,
|
||||
"bootstrap_iters": 100000,
|
||||
"description_dict": {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user