From a73195a193f04c04078d246d31889a78f811a998 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Fri, 22 May 2026 03:44:16 +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: ChanceFocus/finma-7b-nlp Source: Original Platform --- .gitattributes | 34 +++++++++++++++++++ README.md | 73 +++++++++++++++++++++++++++++++++++++++++ added_tokens.json | 3 ++ config.json | 24 ++++++++++++++ generation_config.json | 7 ++++ pytorch_model.bin | 3 ++ special_tokens_map.json | 6 ++++ tokenizer.model | 3 ++ tokenizer_config.json | 36 ++++++++++++++++++++ 9 files changed, 189 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.bin 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..c7d9f33 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,34 @@ +*.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 +*.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..d0e6bfe --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +--- +datasets: +- chancefocus/pixiu +- ChanceFocus/FLUPE +language: +- en +inference: false +license: mit +metrics: +- accuracy +- exact_match +- f1 +library_name: transformers +tags: +- finance +- llama +- llms + +--- + +# FinMA-7B-NLP + +FinMA-7B-NLP is a financial large language model (LLM) developed as part of the [PIXIU project](https://github.com/chancefocus/PIXIU). It is designed to understand complex financial language and concepts, and is fine-tuned to follow natural language instructions, enhancing its performance in downstream financial tasks. Specifically, FinMA-7B-NLP is trained only on the NLP tasks of the PIXIU dataset, making it specialized for tasks such as sentiment analysis, news headline classification, named entity recognition, and question answering. + +## Other Models in the PIXIU Project + +In addition to FinMA-7B-NLP, the PIXIU project includes two other models: FinMA-7B-full and FinMA-30B. + +- **FinMA-7B-full**: This model is trained with the full instruction data from the PIXIU dataset, covering both NLP and prediction tasks. This makes it a more comprehensive model capable of handling a wider range of financial tasks. + +- **FinMA-30B**: This model is a larger version of FinMA, fine-tuned on the LLaMA-30B model. Like FinMA-7B-NLP, it is trained with the NLP instruction data. + +## Usage + +You can use the FinMA-7B-NLP model in your Python project with the Hugging Face Transformers library. Here is a simple example of how to load the model: + +```python +from transformers import LlamaTokenizer, LlamaForCausalLM + +tokenizer = LlamaTokenizer.from_pretrained('ChanceFocus/finma-7b-nlp') +model = LlamaForCausalLM.from_pretrained('ChanceFocus/finma-7b-nlp', device_map='auto') +``` + +In this example, LlamaTokenizer is used to load the tokenizer, and LlamaForCausalLM is used to load the model. The `device_map='auto'` argument is used to automatically use the GPU if it's available. + +## Hosted Inference API + +You can also use the model through the Hugging Face Inference API. This allows you to generate text without having to set up your own inference environment. The model can be loaded on the Inference API on-demand. + +## License + +FinMA-7B-NLP is licensed under MIT. For more details, please see the MIT file. + +## About + +This model is part of the PIXIU project, an open-source resource featuring the first financial large language models (LLMs), instruction tuning data, and evaluation benchmarks to holistically assess financial LLMs. The goal is to continually push forward the open-source development of financial artificial intelligence (AI). + +For more information, you can visit the [PIXIU](https://github.com/chancefocus/PIXIU) project on GitHub. + +## Citation + +If you use FinMA-7B-NLP in your work, please cite the PIXIU paper: + +```bibtex +@misc{xie2023pixiu, + title={PIXIU: A Large Language Model, Instruction Data and Evaluation Benchmark for Finance}, + author={Qianqian Xie and Weiguang Han and Xiao Zhang and Yanzhao Lai and Min Peng and Alejandro Lopez-Lira and Jimin Huang}, + year={2023}, + eprint={2306.05443}, + archivePrefix={arXiv}, + primaryClass={cs.CL} +} +``` \ No newline at end of file diff --git a/added_tokens.json b/added_tokens.json new file mode 100644 index 0000000..7a2e71b --- /dev/null +++ b/added_tokens.json @@ -0,0 +1,3 @@ +{ + "": 32000 +} diff --git a/config.json b/config.json new file mode 100644 index 0000000..795682d --- /dev/null +++ b/config.json @@ -0,0 +1,24 @@ +{ + "_name_or_path": "vicuna-7b", + "architectures": [ + "LlamaForCausalLM" + ], + "bos_token_id": 0, + "eos_token_id": 1, + "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, + "pad_token_id": -1, + "rms_norm_eps": 1e-06, + "tie_word_embeddings": false, + "torch_dtype": "float16", + "transformers_version": "4.29.2", + "use_cache": false, + "vocab_size": 32000 +} diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..517f415 --- /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.29.2" +} diff --git a/pytorch_model.bin b/pytorch_model.bin new file mode 100644 index 0000000..8856a7f --- /dev/null +++ b/pytorch_model.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d7087bfca003c9e2f7295a6a1550795848770f88af5c034ae6876ce06be9216 +size 26953778121 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..09a41a3 --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,6 @@ +{ + "bos_token": "", + "eos_token": "", + "pad_token": "", + "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..176c8f6 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,36 @@ +{ + "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 + }, + "legacy": null, + "model_max_length": 1000000000000000019884624838656, + "pad_token": null, + "sp_model_kwargs": {}, + "spaces_between_special_tokens": false, + "tokenizer_class": "LlamaTokenizer", + "unk_token": { + "__type": "AddedToken", + "content": "", + "lstrip": false, + "normalized": true, + "rstrip": false, + "single_word": false + }, + "use_default_system_prompt": true +}