From 70808ec56ec199ce072fd5ca35a34a7afb451a55 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Mon, 29 Jun 2026 03:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: RedHatAI/Llama-2-7b-dolphin-open_platypus Source: Original Platform --- .gitattributes | 35 ++++++++++++++++ README.md | 68 ++++++++++++++++++++++++++++++++ arc_challenge.json | 25 ++++++++++++ config.json | 28 +++++++++++++ configuration.json | 1 + generation_config.json | 6 +++ gsm8k.json | 23 +++++++++++ hellaswag.json | 25 ++++++++++++ mmlu.json | 3 ++ model-00001-of-00002.safetensors | 3 ++ model-00002-of-00002.safetensors | 3 ++ model.safetensors.index.json | 3 ++ special_tokens_map.json | 23 +++++++++++ tokenizer.json | 3 ++ tokenizer.model | 3 ++ tokenizer_config.json | 41 +++++++++++++++++++ truthfulqa_mc.json | 25 ++++++++++++ winogrande.json | 23 +++++++++++ 18 files changed, 341 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 arc_challenge.json create mode 100644 config.json create mode 100644 configuration.json create mode 100644 generation_config.json create mode 100644 gsm8k.json create mode 100644 hellaswag.json create mode 100644 mmlu.json create mode 100644 model-00001-of-00002.safetensors create mode 100644 model-00002-of-00002.safetensors create mode 100644 model.safetensors.index.json create mode 100644 special_tokens_map.json create mode 100644 tokenizer.json create mode 100644 tokenizer.model create mode 100644 tokenizer_config.json create mode 100644 truthfulqa_mc.json create mode 100644 winogrande.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a6344aa --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..79b5881 --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +--- +base_model: meta-llama/Llama-2-7b-hf +inference: true +model_type: llama +pipeline_tag: text-generation +datasets: + - garage-bAInd/Open-Platypus + - Open-Orca/OpenOrca + - cognitivecomputations/dolphin +tags: +- instruct +--- + +# Llama-2-7b-instruct + +This repo contains a [Llama 2 7B](https://huggingface.co/meta-llama/Llama-2-7b-hf) 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("neuralmagic/Llama-2-7b-instruct") +model = AutoModelForCausalLM.from_pretrained("neuralmagic/Llama-2-7b-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, top-1 | xxxx | xxxx | +| [HellaSwag](https://arxiv.org/abs/1905.07830) | 0-shot | xxxx | xxxx | +| [WinoGrande](https://arxiv.org/abs/1907.10641) | partial score | xxxx | xxxx | +| [ARC-c](https://arxiv.org/abs/1911.01547) | | xxxx | xxxx | +| [TruthfulQA](https://arxiv.org/abs/2109.07958) | 5-shot | xxxx | xxxx | +| [HumanEval](https://arxiv.org/abs/2107.03374) | pass@1 | xxxx | xxxx | +| [GSM8K](https://arxiv.org/abs/2110.14168) | maj@1 | xxxx | xxxx | + +## Model Training Details + +Coming soon. + +## 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) \ No newline at end of file diff --git a/arc_challenge.json b/arc_challenge.json new file mode 100644 index 0000000..73d7737 --- /dev/null +++ b/arc_challenge.json @@ -0,0 +1,25 @@ +{ + "results": { + "arc_challenge": { + "acc": 0.5136518771331058, + "acc_stderr": 0.014605943429860947, + "acc_norm": 0.5409556313993175, + "acc_norm_stderr": 0.014562291073601229 + } + }, + "versions": { + "arc_challenge": 0 + }, + "config": { + "model": "hf", + "model_args": "pretrained=/cache/shubhra/models/llama2_denseft_playtpus_dolphin_LR1e-5_E2_noGC_LRScosine/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": {} + } +} \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..0b50f35 --- /dev/null +++ b/config.json @@ -0,0 +1,28 @@ +{ + "_name_or_path": "neuralmagic/Llama-2-7b-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, + "torch_dtype": "bfloat16", + "transformers_version": "1.7.0.43401", + "use_cache": true, + "vocab_size": 32000 +} diff --git a/configuration.json b/configuration.json new file mode 100644 index 0000000..bbeeda1 --- /dev/null +++ b/configuration.json @@ -0,0 +1 @@ +{"framework": "pytorch", "task": "text-generation", "allow_remote": true} \ No newline at end of file diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..b9f5b6d --- /dev/null +++ b/generation_config.json @@ -0,0 +1,6 @@ +{ + "_from_model_config": true, + "bos_token_id": 1, + "eos_token_id": 2, + "transformers_version": "1.7.0.43401" +} diff --git a/gsm8k.json b/gsm8k.json new file mode 100644 index 0000000..4c93a05 --- /dev/null +++ b/gsm8k.json @@ -0,0 +1,23 @@ +{ + "results": { + "gsm8k": { + "acc": 0.1516300227445034, + "acc_stderr": 0.009879331091354313 + } + }, + "versions": { + "gsm8k": 0 + }, + "config": { + "model": "hf", + "model_args": "pretrained=/cache/shubhra/models/llama2_denseft_playtpus_dolphin_LR1e-5_E2_noGC_LRScosine/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": {} + } +} \ No newline at end of file diff --git a/hellaswag.json b/hellaswag.json new file mode 100644 index 0000000..56c18d0 --- /dev/null +++ b/hellaswag.json @@ -0,0 +1,25 @@ +{ + "results": { + "hellaswag": { + "acc": 0.5950009958175663, + "acc_stderr": 0.0048988860806879276, + "acc_norm": 0.793666600278829, + "acc_norm_stderr": 0.004038455815535897 + } + }, + "versions": { + "hellaswag": 0 + }, + "config": { + "model": "hf", + "model_args": "pretrained=/cache/shubhra/models/llama2_denseft_playtpus_dolphin_LR1e-5_E2_noGC_LRScosine/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": {} + } +} \ No newline at end of file diff --git a/mmlu.json b/mmlu.json new file mode 100644 index 0000000..a369935 --- /dev/null +++ b/mmlu.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0577110965a4ba90178122f31d0e0c89f69b0768a4e623fba0db25a1967757f4 +size 14293 diff --git a/model-00001-of-00002.safetensors b/model-00001-of-00002.safetensors new file mode 100644 index 0000000..54a98aa --- /dev/null +++ b/model-00001-of-00002.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abcc8fc90cc6d1156c0e6c6f20493031e6ad8c7312e76d5b6a736ff1d73d93dd +size 9976570520 diff --git a/model-00002-of-00002.safetensors b/model-00002-of-00002.safetensors new file mode 100644 index 0000000..931d725 --- /dev/null +++ b/model-00002-of-00002.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f07a69d6ca04193259443522cd7e2b44558af94c191f3a91f2073729ddfc262e +size 3500294544 diff --git a/model.safetensors.index.json b/model.safetensors.index.json new file mode 100644 index 0000000..02c356f --- /dev/null +++ b/model.safetensors.index.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:610194b49eade5f9d8ff8702c373fdd515269847f6d36425355ed1c2fd31f348 +size 23950 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..451134b --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,23 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..21779d6 --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcd04f0eadf90287bd26e1a183ac487d8a141b09b06aecb7725bbdd343640f2e +size 1842767 diff --git a/tokenizer.model b/tokenizer.model new file mode 100644 index 0000000..6c00c74 --- /dev/null +++ b/tokenizer.model @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347 +size 499723 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..120fe80 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,41 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + } + }, + "bos_token": "", + "clean_up_tokenization_spaces": false, + "eos_token": "", + "legacy": false, + "model_max_length": 1000000000000000019884624838656, + "pad_token": null, + "padding_side": "right", + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizer", + "unk_token": "", + "use_default_system_prompt": false +} diff --git a/truthfulqa_mc.json b/truthfulqa_mc.json new file mode 100644 index 0000000..46f51dd --- /dev/null +++ b/truthfulqa_mc.json @@ -0,0 +1,25 @@ +{ + "results": { + "truthfulqa_mc": { + "mc1": 0.2802937576499388, + "mc1_stderr": 0.015723139524608763, + "mc2": 0.4267590294350202, + "mc2_stderr": 0.014157890438760036 + } + }, + "versions": { + "truthfulqa_mc": 1 + }, + "config": { + "model": "hf", + "model_args": "pretrained=/cache/shubhra/models/llama2_denseft_playtpus_dolphin_LR1e-5_E2_noGC_LRScosine/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": {} + } +} \ No newline at end of file diff --git a/winogrande.json b/winogrande.json new file mode 100644 index 0000000..bd1f0ec --- /dev/null +++ b/winogrande.json @@ -0,0 +1,23 @@ +{ + "results": { + "winogrande": { + "acc": 0.744277821625888, + "acc_stderr": 0.012261253845440474 + } + }, + "versions": { + "winogrande": 0 + }, + "config": { + "model": "hf", + "model_args": "pretrained=/cache/shubhra/models/llama2_denseft_playtpus_dolphin_LR1e-5_E2_noGC_LRScosine/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": {} + } +} \ No newline at end of file