commit a51cae0cb577e03b4a63bac15e71fae334763142 Author: ModelHub XC Date: Wed Jul 15 11:44:06 2026 +0800 初始化项目,由ModelHub XC社区提供模型 Model: Weyaxi/Einstein-7B Source: Original Platform 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..791137a --- /dev/null +++ b/README.md @@ -0,0 +1,210 @@ +--- +license: other +tags: +- axolotl +- generated_from_trainer +base_model: mistralai/Mistral-7B-v0.1 +datasets: +- allenai/ai2_arc +- camel-ai/physics +- camel-ai/chemistry +- camel-ai/biology +- metaeval/reclor +- openbookqa +- mandyyyyii/scibench +- derek-thomas/ScienceQA +- wenhu/TheoremQA +- TIGER-Lab/ScienceEval +--- +![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6468ce47e134d050a58aa89c/uvfa4GVWrnd8SS6yBxRJZ.jpeg) + +# 🔬 Einstein-7B + +This model is a fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) on datasets related to science. + +This model is fine-tuned using [QLoRa](https://arxiv.org/abs/2305.14314) and [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl). + +This model's training was sponsored by [sablo.ai](https://sablo.ai). + +
See axolotl config + +axolotl version: `0.3.0` +```yaml +base_model: mistralai/Mistral-7B-v0.1 +model_type: MistralForCausalLM +tokenizer_type: LlamaTokenizer +is_mistral_derived_model: true + +load_in_8bit: false +load_in_4bit: true +strict: false + +datasets: + - path: sci-datasets/arc_challange_train_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_biology_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_chemistry_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_physics_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/openbookqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/reclor_science_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/scibench_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/scienceqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/theoremqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/tiger_scienceeval_alpaca.json + ds_type: json + type: alpaca + +dataset_prepared_path: last_run_prepared +val_set_size: 0 +output_dir: ./science-mistral + +adapter: qlora +lora_model_dir: + +sequence_len: 8192 +sample_packing: true +pad_to_sequence_len: true + +lora_r: 128 +lora_alpha: 64 +lora_dropout: 0.05 +lora_target_linear: true +lora_fan_in_fan_out: +lora_target_modules: + - gate_proj + - down_proj + - up_proj + - q_proj + - v_proj + - k_proj + - o_proj + +wandb_project: huggingface +wandb_entity: +wandb_watch: +wandb_name: +wandb_log_model: +hub_model_id: Weyaxi/science-mistral + +# change # +gradient_accumulation_steps: 12 +micro_batch_size: 6 +num_epochs: 2 +optimizer: adamw_bnb_8bit +lr_scheduler: cosine +learning_rate: 0.0002 +# change # + +train_on_inputs: false +group_by_length: false +bf16: true +fp16: false +tf32: false + +gradient_checkpointing: true +early_stopping_patience: +resume_from_checkpoint: +local_rank: +logging_steps: 1 +xformers_attention: +flash_attention: true + +warmup_steps: 10 + + +saves_per_epoch: 3 +debug: +deepspeed: +weight_decay: 0.1 +fsdp: +fsdp_config: +special_tokens: + bos_token: "" + eos_token: "" + unk_token: "" + +``` + +

+ +# 📊 Datasets + +Following datasets were used in this model: + +- [ARC](https://huggingface.co/datasets/allenai/ai2_arc) (Note: Only **train** part) + +- [camel-ai/physics](https://huggingface.co/datasets/camel-ai/physics) + +- [camel-ai/chemistry](https://huggingface.co/datasets/camel-ai/chemistry) + +- [camel-ai/biology](https://huggingface.co/datasets/camel-ai/biology) + +- [openbookqa](https://huggingface.co/datasets/openbookqa) + +- [reclor](https://huggingface.co/datasets/metaeval/reclor) + +- [scibench](https://github.com/mandyyyyii/scibench) + +- [ScienceQA](https://huggingface.co/datasets/derek-thomas/ScienceQA) + +- [TheoremQA](https://huggingface.co/datasets/wenhu/TheoremQA) + +- [ScienceEval](https://huggingface.co/datasets/TIGER-Lab/ScienceEval) + +# 💬 Prompt Template + +You can use this prompt template while using the model: + +### Alpaca + +``` +Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. + +### Instruction: +{instruction} + +### Input: +{input} + +### Response: +``` + +# 🤝 Acknowledgments + +Thanks to Platypus for providing scripts to convert some of the datasets to Alpaca format: [Platypus/data_pipeline](https://github.com/arielnlee/Platypus/tree/main/data_pipeline) + +Thanks to all the dataset authors mentioned in the datasets section. + +Thanks to [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) for making the repository I used to make this model. + +[Built with Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) + +If you would like to support me: + +[☕ Buy Me a Coffee](https://www.buymeacoffee.com/weyaxi) \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..0e63d58 --- /dev/null +++ b/config.json @@ -0,0 +1,26 @@ +{ + "_name_or_path": "mistralai/Mistral-7B-v0.1", + "architectures": [ + "MistralForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": 1, + "eos_token_id": 2, + "hidden_act": "silu", + "hidden_size": 4096, + "initializer_range": 0.02, + "intermediate_size": 14336, + "max_position_embeddings": 32768, + "model_type": "mistral", + "num_attention_heads": 32, + "num_hidden_layers": 32, + "num_key_value_heads": 8, + "rms_norm_eps": 1e-05, + "rope_theta": 10000.0, + "sliding_window": 4096, + "tie_word_embeddings": false, + "torch_dtype": "bfloat16", + "transformers_version": "4.37.0", + "use_cache": false, + "vocab_size": 32000 +} diff --git a/configs/science_config.yml b/configs/science_config.yml new file mode 100644 index 0000000..80741c5 --- /dev/null +++ b/configs/science_config.yml @@ -0,0 +1,117 @@ +base_model: mistralai/Mistral-7B-v0.1 +model_type: MistralForCausalLM +tokenizer_type: LlamaTokenizer +is_mistral_derived_model: true + +load_in_8bit: true +load_in_4bit: false +strict: false + +datasets: + - path: sci-datasets/arc_challange_train_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_biology_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_chemistry_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_physics_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/openbookqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/reclor_science_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/scibench_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/scienceqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/theoremqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/tiger_scienceeval_alpaca.json + ds_type: json + type: alpaca + +dataset_prepared_path: last_run_prepared +val_set_size: 0 +output_dir: ./science-mistral + +adapter: lora +lora_model_dir: + +sequence_len: 8192 +sample_packing: true +pad_to_sequence_len: true + +lora_r: 64 +lora_alpha: 32 +lora_dropout: 0.05 +lora_target_linear: true +lora_fan_in_fan_out: +lora_target_modules: + - gate_proj + - down_proj + - up_proj + - q_proj + - v_proj + - k_proj + - o_proj + +wandb_project: huggingface +wandb_entity: +wandb_watch: +wandb_name: +wandb_log_model: + +# change # +gradient_accumulation_steps: 4 +micro_batch_size: 4 +num_epochs: 1 +optimizer: adamw_bnb_8bit +lr_scheduler: cosine +learning_rate: 0.0002 +# change # + +train_on_inputs: false +group_by_length: false +bf16: true +fp16: false +tf32: false + +gradient_checkpointing: true +early_stopping_patience: +resume_from_checkpoint: +local_rank: +logging_steps: 1 +xformers_attention: +flash_attention: true + +warmup_steps: 10 + + +saves_per_epoch: 2 +debug: +deepspeed: +weight_decay: 0.1 +fsdp: +fsdp_config: +special_tokens: + bos_token: "" + eos_token: "" + unk_token: "" diff --git a/configs/science_config_qlora.yml b/configs/science_config_qlora.yml new file mode 100644 index 0000000..8e4a2d2 --- /dev/null +++ b/configs/science_config_qlora.yml @@ -0,0 +1,118 @@ +base_model: mistralai/Mistral-7B-v0.1 +model_type: MistralForCausalLM +tokenizer_type: LlamaTokenizer +is_mistral_derived_model: true + +load_in_8bit: false +load_in_4bit: true +strict: false + +datasets: + - path: sci-datasets/arc_challange_train_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_biology_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_chemistry_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/camelai_physics_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/openbookqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/reclor_science_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/scibench_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/scienceqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/theoremqa_alpaca.json + ds_type: json + type: alpaca + + - path: sci-datasets/tiger_scienceeval_alpaca.json + ds_type: json + type: alpaca + +dataset_prepared_path: last_run_prepared +val_set_size: 0 +output_dir: ./science-mistral + +adapter: qlora +lora_model_dir: + +sequence_len: 8192 +sample_packing: true +pad_to_sequence_len: true + +lora_r: 128 +lora_alpha: 64 +lora_dropout: 0.05 +lora_target_linear: true +lora_fan_in_fan_out: +lora_target_modules: + - gate_proj + - down_proj + - up_proj + - q_proj + - v_proj + - k_proj + - o_proj + +wandb_project: huggingface +wandb_entity: +wandb_watch: +wandb_name: +wandb_log_model: +hub_model_id: Weyaxi/science-mistral + +# change # +gradient_accumulation_steps: 12 +micro_batch_size: 6 +num_epochs: 2 +optimizer: adamw_bnb_8bit +lr_scheduler: cosine +learning_rate: 0.0002 +# change # + +train_on_inputs: false +group_by_length: false +bf16: true +fp16: false +tf32: false + +gradient_checkpointing: true +early_stopping_patience: +resume_from_checkpoint: +local_rank: +logging_steps: 1 +xformers_attention: +flash_attention: true + +warmup_steps: 10 + + +saves_per_epoch: 3 +debug: +deepspeed: +weight_decay: 0.1 +fsdp: +fsdp_config: +special_tokens: + bos_token: "" + eos_token: "" + unk_token: "" 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..5326931 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,6 @@ +{ + "_from_model_config": true, + "bos_token_id": 1, + "eos_token_id": 2, + "transformers_version": "4.37.0" +} diff --git a/pytorch_model-00001-of-00003.bin b/pytorch_model-00001-of-00003.bin new file mode 100644 index 0000000..6325e32 --- /dev/null +++ b/pytorch_model-00001-of-00003.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be8a9d53c2b48341880a123c127451ae4bd9964707068e90c2e385c55a627eeb +size 4943185145 diff --git a/pytorch_model-00002-of-00003.bin b/pytorch_model-00002-of-00003.bin new file mode 100644 index 0000000..9d11ef3 --- /dev/null +++ b/pytorch_model-00002-of-00003.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6db7d2228e6fca89ae223480ca84c361c85fbdf76c18e2e643157f38233c5ae +size 4999844257 diff --git a/pytorch_model-00003-of-00003.bin b/pytorch_model-00003-of-00003.bin new file mode 100644 index 0000000..c640623 --- /dev/null +++ b/pytorch_model-00003-of-00003.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa93cebe7dad77e365ac3062f04879b9c70aa0a1a84c5798688805b2c07b012b +size 4540536863 diff --git a/pytorch_model.bin.index.json b/pytorch_model.bin.index.json new file mode 100644 index 0000000..01339b4 --- /dev/null +++ b/pytorch_model.bin.index.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fc5f5d86e6a6cea0356e34224ce999c5c3c955a1717ef450579fd161ac8d103 +size 23950 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..72ecfee --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,24 @@ +{ + "bos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "eos_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + }, + "pad_token": "", + "unk_token": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false + } +} diff --git a/tokenizer.model b/tokenizer.model new file mode 100644 index 0000000..8b443ef --- /dev/null +++ b/tokenizer.model @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055 +size 493443 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..3b16a1f --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,44 @@ +{ + "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 + } + }, + "additional_special_tokens": [], + "bos_token": "", + "clean_up_tokenization_spaces": false, + "eos_token": "", + "legacy": true, + "model_max_length": 1000000000000000019884624838656, + "pad_token": "", + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "LlamaTokenizer", + "trust_remote_code": false, + "unk_token": "", + "use_default_system_prompt": false, + "use_fast": true +}