From e02ddcfd23974d8cd9f6b44d872d686b9bd885eb Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Tue, 12 May 2026 18:00:32 +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: MBZUAI/bactrian-x-llama-13b-merged Source: Original Platform --- .gitattributes | 47 ++++++++++++++++++++++ README.md | 69 ++++++++++++++++++++++++++++++++ added_tokens.json | 3 ++ config.json | 24 +++++++++++ configuration.json | 1 + generation_config.json | 7 ++++ pytorch_model-00001-of-00013.bin | 3 ++ pytorch_model-00002-of-00013.bin | 3 ++ pytorch_model-00003-of-00013.bin | 3 ++ pytorch_model-00004-of-00013.bin | 3 ++ pytorch_model-00005-of-00013.bin | 3 ++ pytorch_model-00006-of-00013.bin | 3 ++ pytorch_model-00007-of-00013.bin | 3 ++ pytorch_model-00008-of-00013.bin | 3 ++ pytorch_model-00009-of-00013.bin | 3 ++ pytorch_model-00010-of-00013.bin | 3 ++ pytorch_model-00011-of-00013.bin | 3 ++ pytorch_model-00012-of-00013.bin | 3 ++ pytorch_model-00013-of-00013.bin | 3 ++ pytorch_model.bin.index.json | 3 ++ special_tokens_map.json | 6 +++ tokenizer.model | 3 ++ tokenizer_config.json | 33 +++++++++++++++ 23 files changed, 235 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 added_tokens.json create mode 100644 config.json create mode 100644 configuration.json create mode 100644 generation_config.json create mode 100644 pytorch_model-00001-of-00013.bin create mode 100644 pytorch_model-00002-of-00013.bin create mode 100644 pytorch_model-00003-of-00013.bin create mode 100644 pytorch_model-00004-of-00013.bin create mode 100644 pytorch_model-00005-of-00013.bin create mode 100644 pytorch_model-00006-of-00013.bin create mode 100644 pytorch_model-00007-of-00013.bin create mode 100644 pytorch_model-00008-of-00013.bin create mode 100644 pytorch_model-00009-of-00013.bin create mode 100644 pytorch_model-00010-of-00013.bin create mode 100644 pytorch_model-00011-of-00013.bin create mode 100644 pytorch_model-00012-of-00013.bin create mode 100644 pytorch_model-00013-of-00013.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..53d7257 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,47 @@ +*.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 +*.gguf* filter=lfs diff=lfs merge=lfs -text +*.ggml filter=lfs diff=lfs merge=lfs -text +*.llamafile* filter=lfs diff=lfs merge=lfs -text +*.pt2 filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f77e8f2 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +--- +license: mit +--- + +#### Current Training Steps: 108,000 + + +This repo contains a merged model using low-rank adaptation (LoRA) for LLaMA-13b +fit on the [Stanford-Alpaca-52k](https://github.com/tatsu-lab/stanford_alpaca) +and [databricks-dolly-15k](https://github.com/databrickslabs/dolly/tree/master/data) data in 52 languages. + +### Dataset Creation + +1. English Instructions: The English instuctions are obtained from [alpaca-52k](https://github.com/tatsu-lab/stanford_alpaca), and [dolly-15k](https://github.com/databrickslabs/dolly/tree/master/data). +2. Instruction Translation: The instructions (and inputs) are translated into the target languages using Google Translation API (conducted on April 2023). +3. Output Generation: We generate output from `gpt-3.5-turbo` for each language (conducted on April 2023). + +

+ +

+ +### Training Parameters + +The code for training the model is provided in our [github](https://github.com/mbzuai-nlp/Bactrian-X), which is adapted from [Alpaca-LoRA](https://github.com/tloen/alpaca-lora). +This version of the weights was trained with the following hyperparameters: + + +- Epochs: 10 +- Batch size: 128 +- Cutoff length: 512 +- Learning rate: 3e-4 +- Lora _r_: 64 +- Lora target modules: q_proj, k_proj, v_proj, o_proj + + +That is: + +``` +python finetune.py \ + --base_model='decapoda-research/llama-13b-hf' \ + --num_epochs=5 \ + --batch_size=128 \ + --cutoff_len=512 \ + --group_by_length \ + --output_dir='./bactrian-x-llama-13b-lora' \ + --lora_target_modules='q_proj,k_proj,v_proj,o_proj' \ + --lora_r=64 \ + --micro_batch_size=32 +``` + +Instructions for running it can be found at https://github.com/MBZUAI-nlp/Bactrian-X. + +### Discussion of Biases + +(1) Translation bias; (2) Potential English-culture bias in the translated dataset. + + +### Citation Information + +``` +@misc{li2023bactrianx, + title={Bactrian-X : A Multilingual Replicable Instruction-Following Model with Low-Rank Adaptation}, + author={Haonan Li and Fajri Koto and Minghao Wu and Alham Fikri Aji and Timothy Baldwin}, + year={2023}, + eprint={2305.15011}, + archivePrefix={arXiv}, + primaryClass={cs.CL} +} +``` 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..c72e981 --- /dev/null +++ b/config.json @@ -0,0 +1,24 @@ +{ + "_name_or_path": "decapoda-research/llama-13b-hf", + "architectures": [ + "LlamaForCausalLM" + ], + "bos_token_id": 0, + "eos_token_id": 1, + "hidden_act": "silu", + "hidden_size": 5120, + "initializer_range": 0.02, + "intermediate_size": 13824, + "max_position_embeddings": 2048, + "max_sequence_length": 2048, + "model_type": "llama", + "num_attention_heads": 40, + "num_hidden_layers": 40, + "pad_token_id": -1, + "rms_norm_eps": 1e-06, + "tie_word_embeddings": false, + "torch_dtype": "float16", + "transformers_version": "4.28.1", + "use_cache": true, + "vocab_size": 32001 +} 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..96af869 --- /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.28.1" +} diff --git a/pytorch_model-00001-of-00013.bin b/pytorch_model-00001-of-00013.bin new file mode 100644 index 0000000..b1c2a65 --- /dev/null +++ b/pytorch_model-00001-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af0a0639a6ff6e9acc404afecc6e3c790220c3b0a55215218359306b2e1f2f40 +size 2582179025 diff --git a/pytorch_model-00002-of-00013.bin b/pytorch_model-00002-of-00013.bin new file mode 100644 index 0000000..ded6de9 --- /dev/null +++ b/pytorch_model-00002-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18000bb812e36c3392bc023c809e2140624ff53bf5faae22c536e52cfa301282 +size 2996377799 diff --git a/pytorch_model-00003-of-00013.bin b/pytorch_model-00003-of-00013.bin new file mode 100644 index 0000000..c8ea062 --- /dev/null +++ b/pytorch_model-00003-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b87d073aeeaa25ad17443a63b6a220edb947864bc3d56bfa86ea96c6d747689 +size 3313592985 diff --git a/pytorch_model-00004-of-00013.bin b/pytorch_model-00004-of-00013.bin new file mode 100644 index 0000000..6a1afe7 --- /dev/null +++ b/pytorch_model-00004-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e55f2a1be007e0acca126f0241cab50a9f4e87c98cba08765b314b281ee68a15 +size 2959678041 diff --git a/pytorch_model-00005-of-00013.bin b/pytorch_model-00005-of-00013.bin new file mode 100644 index 0000000..0143a39 --- /dev/null +++ b/pytorch_model-00005-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5f44ee5d124834239892942a2581b4035634466f0c0f463759a9546041aa507 +size 2959678635 diff --git a/pytorch_model-00006-of-00013.bin b/pytorch_model-00006-of-00013.bin new file mode 100644 index 0000000..cd1120c --- /dev/null +++ b/pytorch_model-00006-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:364a7e5ff8c746152f4b957bc14abcbe30fb30fdc0e62a5d987f32caa6cc609c +size 2996377863 diff --git a/pytorch_model-00007-of-00013.bin b/pytorch_model-00007-of-00013.bin new file mode 100644 index 0000000..b16736b --- /dev/null +++ b/pytorch_model-00007-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50d354da4d7d88bb788813adb72e1bd4318b323cf03bf630b22fa23dcc7df5d5 +size 2996377863 diff --git a/pytorch_model-00008-of-00013.bin b/pytorch_model-00008-of-00013.bin new file mode 100644 index 0000000..c0318d0 --- /dev/null +++ b/pytorch_model-00008-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e072df4b28cb9b76be25c6c22b7df77ecf29640f5452d81522d155cba18beae6 +size 3313593049 diff --git a/pytorch_model-00009-of-00013.bin b/pytorch_model-00009-of-00013.bin new file mode 100644 index 0000000..e562b54 --- /dev/null +++ b/pytorch_model-00009-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:064e9fb387648a0fe7ccd6f921c857090a1d3cb6d70a048d416d04864e30a452 +size 2959678041 diff --git a/pytorch_model-00010-of-00013.bin b/pytorch_model-00010-of-00013.bin new file mode 100644 index 0000000..fa56180 --- /dev/null +++ b/pytorch_model-00010-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49bdd5b774d738bfa8dcadff68298d32b4b403869866d32bccc35dbd571bf3a0 +size 2959678635 diff --git a/pytorch_model-00011-of-00013.bin b/pytorch_model-00011-of-00013.bin new file mode 100644 index 0000000..8058820 --- /dev/null +++ b/pytorch_model-00011-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:500badeb35772b1d9139b6e63e3a8c409fbe9cadcd41fbf50d13d9d36e246720 +size 2996377863 diff --git a/pytorch_model-00012-of-00013.bin b/pytorch_model-00012-of-00013.bin new file mode 100644 index 0000000..599af00 --- /dev/null +++ b/pytorch_model-00012-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf293bd051d337d5e23f037dfcf4652ea5056dd9ee7d209c255ea3215fd9d2e9 +size 2996377863 diff --git a/pytorch_model-00013-of-00013.bin b/pytorch_model-00013-of-00013.bin new file mode 100644 index 0000000..2a1508b --- /dev/null +++ b/pytorch_model-00013-of-00013.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:015e760366136cda7384f2e088f5b4bd9f71b9ab5f63c49f2df3823dd5d874a9 +size 3017367643 diff --git a/pytorch_model.bin.index.json b/pytorch_model.bin.index.json new file mode 100644 index 0000000..3bbaf7c --- /dev/null +++ b/pytorch_model.bin.index.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d45e8cc0f5dc0663bd4987a19631fcc783d868511d5b9c0b668cc3b5437aee3 +size 33444 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..9a53a9d --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,33 @@ +{ + "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": 1000000000000000019884624838656, + "pad_token": null, + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizer", + "unk_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + } +}