From 11194e7de47fa093b5a1852df13a62e9ed241c89 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Fri, 17 Jul 2026 22:23:06 +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: Data-Juicer/LLaMA-7B-EN-Chat-40k Source: Original Platform --- .gitattributes | 38 ++++++++++++++++++++ README.md | 59 ++++++++++++++++++++++++++++++++ added_tokens.json | 3 ++ config.json | 28 +++++++++++++++ generation_config.json | 7 ++++ pytorch_model-00001-of-00003.bin | 3 ++ pytorch_model-00002-of-00003.bin | 3 ++ pytorch_model-00003-of-00003.bin | 3 ++ pytorch_model.bin.index.json | 3 ++ special_tokens_map.json | 6 ++++ tokenizer.model | 3 ++ tokenizer_config.json | 34 ++++++++++++++++++ 12 files changed, 190 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 added_tokens.json create mode 100644 config.json create mode 100644 generation_config.json create mode 100644 pytorch_model-00001-of-00003.bin create mode 100644 pytorch_model-00002-of-00003.bin create mode 100644 pytorch_model-00003-of-00003.bin create mode 100644 pytorch_model.bin.index.json create mode 100644 special_tokens_map.json create mode 100644 tokenizer.model create mode 100644 tokenizer_config.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4d70de8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,38 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bin.* filter=lfs diff=lfs merge=lfs -text +*.bz2 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 +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack 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 +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +saved_model/**/* 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 +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zstandard filter=lfs diff=lfs merge=lfs -text +*.tfevents* filter=lfs diff=lfs merge=lfs -text +*.db* filter=lfs diff=lfs merge=lfs -text +*.ark* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +pytorch_model-00001-of-00003.bin filter=lfs diff=lfs merge=lfs -text +pytorch_model-00002-of-00003.bin filter=lfs diff=lfs merge=lfs -text +pytorch_model-00003-of-00003.bin filter=lfs diff=lfs merge=lfs -text +tokenizer.model filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..56675ee --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +--- +frameworks: +- Pytorch +license: Apache License 2.0 +tasks: +- text-generation +datasets: + train: + - Data-Juicer/alpaca-cot-en-refined-by-data-juicer +tags: +- data-juicer +- arxiv:2309.02033 +--- +## News + Our first data-centric LLM competition begins! Please visit the competition's official websites, **FT-Data Ranker** ([1B Track](https://tianchi.aliyun.com/competition/entrance/532157), [7B Track](https://tianchi.aliyun.com/competition/entrance/532158)), for more information. +## Introduction +This is a reference LLM from [Data-Juicer](https://github.com/alibaba/data-juicer). + +The model architecture is LLaMA-7B and we built it upon the pre-trained [checkpoint](https://huggingface.co/huggyllama/llama-7b). +The model is fine-trained on 40k English chat samples of Data-Juicer's refined [alpaca-CoT data](https://github.com/alibaba/data-juicer/blob/main/configs/data_juicer_recipes/alpaca_cot/README.md#refined-alpaca-cot-dataset-meta-info). +It beats LLaMA-7B fine-tuned on 52k Alpaca samples in GPT-4 evaluation. + +For more details, please refer to our [paper](https://arxiv.org/abs/2309.02033). + +![exp_llama](https://img.alicdn.com/imgextra/i2/O1CN019WtUPP1uhebnDlPR8_!!6000000006069-2-tps-2530-1005.png) + +## 使用 +```python + +from modelscope import ( + AutoModelForCausalLM, AutoTokenizer, GenerationConfig, snapshot_download +) +model_dir = 'LLaMA-7B-EN-Chat-40k' + +tokenizer = AutoTokenizer.from_pretrained(model_dir) +model = AutoModelForCausalLM.from_pretrained(model_dir).eval() + +inputs = tokenizer('How are you?', return_tensors='pt').to(model.device) +response = model.generate(inputs.input_ids, max_length=128) +print(tokenizer.decode(response.cpu()[0], skip_special_tokens=True)) +``` + +## 参考 +If you find our work useful for your research or development, please kindly cite the following [paper](https://arxiv.org/abs/2309.02033). +``` +@misc{chen2023datajuicer, +title={Data-Juicer: A One-Stop Data Processing System for Large Language Models}, +author={Daoyuan Chen and Yilun Huang and Zhijian Ma and Hesen Chen and Xuchen Pan and Ce Ge and Dawei Gao and Yuexiang Xie and Zhaoyang Liu and Jinyang Gao and Yaliang Li and Bolin Ding and Jingren Zhou}, +year={2023}, +eprint={2309.02033}, +archivePrefix={arXiv}, +primaryClass={cs.LG} +} +``` + +#### Clone with HTTP +```bash + git clone https://www.modelscope.cn/Data-Juicer/LLaMA-7B-EN-Chat-40k.git +``` diff --git a/added_tokens.json b/added_tokens.json new file mode 100644 index 0000000..e41416d --- /dev/null +++ b/added_tokens.json @@ -0,0 +1,3 @@ +{ + "[PAD]": 32000 +} diff --git a/config.json b/config.json new file mode 100644 index 0000000..53e18e6 --- /dev/null +++ b/config.json @@ -0,0 +1,28 @@ +{ + "_name_or_path": "llama-7b_en_sft_hist_ratio_40k", + "architectures": [ + "LlamaForCausalLM" + ], + "bos_token_id": 1, + "eos_token_id": 2, + "hidden_act": "silu", + "hidden_size": 4096, + "initializer_range": 0.02, + "intermediate_size": 11008, + "max_position_embeddings": 2048, + "max_sequence_length": 2048, + "model_type": "llama", + "num_attention_heads": 32, + "num_hidden_layers": 32, + "num_key_value_heads": 32, + "pad_token_id": 32000, + "pretraining_tp": 1, + "rms_norm_eps": 1e-06, + "rope_scaling": null, + "tie_word_embeddings": false, + "torch_dtype": "float32", + "transformers_version": "4.31.0", + "unk_token_id": 0, + "use_cache": true, + "vocab_size": 32001 +} diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..4fd1bf1 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,7 @@ +{ + "_from_model_config": true, + "bos_token_id": 0, + "eos_token_id": 1, + "pad_token_id": 0, + "transformers_version": "4.31.0" +} diff --git a/pytorch_model-00001-of-00003.bin b/pytorch_model-00001-of-00003.bin new file mode 100644 index 0000000..5302c85 --- /dev/null +++ b/pytorch_model-00001-of-00003.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:531c0b995f797f7f0a9cb518d39f9e614255ca5033cd37d46b6a696078a939d5 +size 9878005970 diff --git a/pytorch_model-00002-of-00003.bin b/pytorch_model-00002-of-00003.bin new file mode 100644 index 0000000..69f3a26 --- /dev/null +++ b/pytorch_model-00002-of-00003.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:018e97c895f8b0a681f2544487b330773954a2ba7965e43da8d43fdddb0ba970 +size 9894801014 diff --git a/pytorch_model-00003-of-00003.bin b/pytorch_model-00003-of-00003.bin new file mode 100644 index 0000000..48c0c42 --- /dev/null +++ b/pytorch_model-00003-of-00003.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94c6dacc4af2cd98a5eacdae37b10beaf3b00027eed11c25580f062e1586d50b +size 7181007033 diff --git a/pytorch_model.bin.index.json b/pytorch_model.bin.index.json new file mode 100644 index 0000000..bf0adc0 --- /dev/null +++ b/pytorch_model.bin.index.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:761343a6add14e4839ed3b687e168bd2a545c2ba1d42596c2721943db7738576 +size 26788 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..3f58a5e --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,6 @@ +{ + "bos_token": "", + "eos_token": "", + "pad_token": "[PAD]", + "unk_token": "" +} 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..b0fbed5 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,34 @@ +{ + "add_bos_token": true, + "add_eos_token": false, + "bos_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "clean_up_tokenization_spaces": false, + "eos_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "model_max_length": 1024, + "pad_token": null, + "padding_side": "right", + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizer", + "unk_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + } +}