From eba409ac8b440c056dd6370f4494c3c133b75aec Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Thu, 7 May 2026 17:56:59 +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: dphn/dolphin-2.9.2-Phi-3-Medium Source: Original Platform --- .gitattributes | 35 ++++++++ README.md | 60 ++++++++++++++ added_tokens.json | 14 ++++ axolotl.yml | 118 ++++++++++++++++++++++++++ config.json | 27 ++++++ configuration.json | 1 + generation_config.json | 12 +++ pytorch_model-00001-of-00006.bin | 3 + pytorch_model-00002-of-00006.bin | 3 + pytorch_model-00003-of-00006.bin | 3 + pytorch_model-00004-of-00006.bin | 3 + pytorch_model-00005-of-00006.bin | 3 + pytorch_model-00006-of-00006.bin | 3 + pytorch_model.bin.index.json | 3 + special_tokens_map.json | 30 +++++++ tokenizer.json | 3 + tokenizer.model | 3 + tokenizer_config.json | 137 +++++++++++++++++++++++++++++++ 18 files changed, 461 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 added_tokens.json create mode 100644 axolotl.yml create mode 100644 config.json create mode 100644 configuration.json create mode 100644 generation_config.json create mode 100644 pytorch_model-00001-of-00006.bin create mode 100644 pytorch_model-00002-of-00006.bin create mode 100644 pytorch_model-00003-of-00006.bin create mode 100644 pytorch_model-00004-of-00006.bin create mode 100644 pytorch_model-00005-of-00006.bin create mode 100644 pytorch_model-00006-of-00006.bin create mode 100644 pytorch_model.bin.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 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..caeb135 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +--- +license: mit +language: +- en +base_model: +- unsloth/Phi-3-mini-4k-instruct +datasets: +- cognitivecomputations/Dolphin-2.9.2 +- teknium/OpenHermes-2.5 +- m-a-p/CodeFeedback-Filtered-Instruction +- cognitivecomputations/dolphin-coder +- cognitivecomputations/samantha-data +- microsoft/orca-math-word-problems-200k +- internlm/Agent-FLAN +- cognitivecomputations/SystemChat-2.0 +--- + +# Dolphin 2.9.2 Phi 3 Medium 🐬 + +Curated and trained by Eric Hartford, Lucas Atkins, Fernando Fernandes, and with help from the community of Cognitive Computations + +[![Discord](https://img.shields.io/discord/1156064224225808488?logo=Discord&logoColor=%23ffffff&label=Discord&link=https%3A%2F%2Fdiscord.gg%2FtCMkMDDHwm)](https://discord.gg/cognitivecomputations) +Discord: https://discord.gg/cognitivecomputations + + + +Our appreciation for the sponsor of Dolphin 2.9.2: +- [Crusoe Cloud](https://crusoe.ai/) - provided excellent on-demand 8xL40Snode + +This model is based on Phi-3-Medium-Instruct-4k, and is governed by the MIT license with which Microsoft released Phi-3. + +Since Microsoft only released the fine-tuned model - Dolphin-2.9.2-Phi-3-Medium has not been entirely cleaned of refusals. + +The base model has 4k context, and the qLoRA fine-tuning was with 4k sequence length. + +It took 3.5 days on 8xL40S node provided by Crusoe Cloud + +This model uses the ChatML prompt template. + +example: + +``` +<|im_start|>system +You are Dolphin, a helpful AI assistant.<|im_end|> +<|im_start|>user +{prompt}<|im_end|> +<|im_start|>assistant + +``` + +Dolphin-2.9.2 has a variety of instruction, conversational, and coding skills. It also has initial agentic abilities and supports function calling. +We have filtered the dataset to remove alignment and bias. This makes the model more compliant. You are advised to implement your own alignment layer before exposing the model as a service. Please read my blog post about uncensored models. https://erichartford.com/uncensored-models You are responsible for any content you create using this model. Enjoy responsibly. + + +![image/png](https://cdn-uploads.huggingface.co/production/uploads/63111b2d88942700629f5771/3dLaIlx3pVme2jWEtwbNp.png) + +[Built with Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) + +## evals: + \ No newline at end of file diff --git a/added_tokens.json b/added_tokens.json new file mode 100644 index 0000000..f9c61bc --- /dev/null +++ b/added_tokens.json @@ -0,0 +1,14 @@ +{ + "<|assistant|>": 32001, + "<|endoftext|>": 32000, + "<|end|>": 32007, + "<|im_end|>": 32011, + "<|placeholder1|>": 32002, + "<|placeholder2|>": 32003, + "<|placeholder3|>": 32004, + "<|placeholder4|>": 32005, + "<|placeholder5|>": 32008, + "<|placeholder6|>": 32009, + "<|system|>": 32006, + "<|user|>": 32010 +} diff --git a/axolotl.yml b/axolotl.yml new file mode 100644 index 0000000..4f7484b --- /dev/null +++ b/axolotl.yml @@ -0,0 +1,118 @@ +base_model: unsloth/Phi-3-medium-4k-instruct +model_type: AutoModelForCausalLM +tokenizer_type: AutoTokenizer + +trust_remote_code: true + +# load_in_8bit: true +load_in_4bit: true +# strict: false + +datasets: + - path: /workspace/datasets/dolphin-2.9.2/dolphin201-sharegpt2.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/dolphin-coder-codegen-sharegpt2.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/dolphin-coder-translate-sharegpt2.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/m-a-p_Code-Feedback-sharegpt-unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/m-a-p_CodeFeedback-Filtered-Instruction-sharegpt-unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/not_samantha_norefusals.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/openhermes200k_unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/Orca-Math-resort-unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/SystemChat_sharegpt.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/toolbench_instruct_j1s1_3k_unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/toolbench_negative_unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/toolbench_react_10p_unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/toolbench_tflan_cot_30p_unfiltered.jsonl + type: sharegpt + conversation: chatml + - path: /workspace/datasets/dolphin-2.9.2/agent_instruct_react_unfiltered.jsonl + type: sharegpt + conversation: chatml + + +chat_template: chatml +dataset_prepared_path: phi-14-data +val_set_size: 0.01 +output_dir: phi-14 + +sequence_len: 4096 # supports up to 8192 +sample_packing: true +pad_to_sequence_len: true + +adapter: qlora +lora_model_dir: +lora_r: 32 +lora_alpha: 16 +lora_dropout: 0.05 +lora_modules_to_save: [embed_tokens, lm_head] +lora_target_linear: true +lora_fan_in_fan_out: + +wandb_project: Phi-3-14b +wandb_entity: +wandb_watch: +wandb_name: +wandb_log_model: + +gradient_accumulation_steps: 4 +micro_batch_size: 4 +num_epochs: 3 +optimizer: adamw_torch_fused +lr_scheduler: cosine +learning_rate: 4e-4 + +train_on_inputs: false +group_by_length: false +bf16: auto +fp16: +tf32: false + +gradient_checkpointing: true +early_stopping_patience: +resume_from_checkpoint: +local_rank: +logging_steps: 1 +xformers_attention: +flash_attention: true + +warmup_steps: 10 +# evals_per_epoch: 2 +# eval_table_size: +# eval_max_new_tokens: 128 +saves_per_epoch: 2 +save_total_limit: 1 +debug: +deepspeed: /workspace/axolotl/deepspeed_configs/zero3_bf16.json +weight_decay: 0.1 +fsdp: +fsdp_config: +special_tokens: + pad_token: "<|placeholder6|>" + eos_token: "<|im_end|>" + bos_token: "" + unk_token: "" + tokens: + - <|im_start|> diff --git a/config.json b/config.json new file mode 100644 index 0000000..2fd0503 --- /dev/null +++ b/config.json @@ -0,0 +1,27 @@ +{ + "_name_or_path": "unsloth/Phi-3-medium-4k-instruct", + "architectures": [ + "MistralForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": 1, + "eos_token_id": 32011, + "hidden_act": "silu", + "hidden_size": 5120, + "initializer_range": 0.02, + "intermediate_size": 17920, + "max_position_embeddings": 4096, + "model_type": "mistral", + "num_attention_heads": 40, + "num_hidden_layers": 40, + "num_key_value_heads": 10, + "pad_token_id": 32009, + "rms_norm_eps": 1e-05, + "rope_theta": 10000.0, + "sliding_window": 2048, + "tie_word_embeddings": false, + "torch_dtype": "bfloat16", + "transformers_version": "4.40.2", + "use_cache": false, + "vocab_size": 32064 +} 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..1d6a743 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,12 @@ +{ + "_from_model_config": true, + "bos_token_id": 1, + "do_sample": true, + "eos_token_id": [ + 32000, + 32001, + 32007 + ], + "pad_token_id": 32009, + "transformers_version": "4.40.2" +} diff --git a/pytorch_model-00001-of-00006.bin b/pytorch_model-00001-of-00006.bin new file mode 100644 index 0000000..cb8812c --- /dev/null +++ b/pytorch_model-00001-of-00006.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6347785e125f2c3f37d11ae807510c788a7a38e0a86f410ef343fc099d8d4316 +size 4916000080 diff --git a/pytorch_model-00002-of-00006.bin b/pytorch_model-00002-of-00006.bin new file mode 100644 index 0000000..772d460 --- /dev/null +++ b/pytorch_model-00002-of-00006.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ace703dda6ec30ce7cf806038f79dce0042ea06187790439a21d6adf4dd4e19 +size 4954709034 diff --git a/pytorch_model-00003-of-00006.bin b/pytorch_model-00003-of-00006.bin new file mode 100644 index 0000000..d3e96e8 --- /dev/null +++ b/pytorch_model-00003-of-00006.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f80121eee8a62140a8701408a14c28e3647bdf174971b4416247fc36c1ec1d8 +size 4902260228 diff --git a/pytorch_model-00004-of-00006.bin b/pytorch_model-00004-of-00006.bin new file mode 100644 index 0000000..2c2e700 --- /dev/null +++ b/pytorch_model-00004-of-00006.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f6bbd6d686889d28ee15b879aa9d8b47982c121ca9132d44f722e3fb4723db +size 4954687950 diff --git a/pytorch_model-00005-of-00006.bin b/pytorch_model-00005-of-00006.bin new file mode 100644 index 0000000..5862d19 --- /dev/null +++ b/pytorch_model-00005-of-00006.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7e355554ea6eb82395427db527793e09a08a4beecee3dbb25f1040ef4502d60 +size 4954687866 diff --git a/pytorch_model-00006-of-00006.bin b/pytorch_model-00006-of-00006.bin new file mode 100644 index 0000000..d348541 --- /dev/null +++ b/pytorch_model-00006-of-00006.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c8087f6f0fc1ce78dc39a2917b89af6ecf5d245d73c42c68b8288a250927fa6 +size 3238261068 diff --git a/pytorch_model.bin.index.json b/pytorch_model.bin.index.json new file mode 100644 index 0000000..80781cd --- /dev/null +++ b/pytorch_model.bin.index.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b19bb1afcbdc49fe580fd46d28babd6197ac9bd2ba961e4d9b52c552847b2dca +size 29894 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..6fdab43 --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,30 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "<|im_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": { + "content": "<|placeholder6|>", + "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..7dbff44 --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16dedaee7335db3536191780d47c1f59c124163d5365067e5fe36bc9758d4c7c +size 1844623 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..a6dd3a0 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,137 @@ +{ + "add_bos_token": false, + "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": true, + "single_word": false, + "special": false + }, + "32000": { + "content": "<|endoftext|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "32001": { + "content": "<|assistant|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32002": { + "content": "<|placeholder1|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32003": { + "content": "<|placeholder2|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32004": { + "content": "<|placeholder3|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32005": { + "content": "<|placeholder4|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32006": { + "content": "<|system|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32007": { + "content": "<|end|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32008": { + "content": "<|placeholder5|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32009": { + "content": "<|placeholder6|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "32010": { + "content": "<|user|>", + "lstrip": false, + "normalized": false, + "rstrip": true, + "single_word": false, + "special": true + }, + "32011": { + "content": "<|im_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + } + }, + "bos_token": "", + "chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}", + "clean_up_tokenization_spaces": false, + "eos_token": "<|im_end|>", + "model_max_length": 4096, + "pad_token": "<|placeholder6|>", + "padding_side": "left", + "sp_model_kwargs": {}, + "tokenizer_class": "LlamaTokenizer", + "unk_token": "", + "use_default_system_prompt": false +}