初始化项目,由ModelHub XC社区提供模型

Model: ChanceFocus/finma-7b-nlp
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-22 03:44:16 +08:00
commit a73195a193
9 changed files with 189 additions and 0 deletions

34
.gitattributes vendored Normal file
View File

@@ -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

73
README.md Normal file
View File

@@ -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}
}
```

3
added_tokens.json Normal file
View File

@@ -0,0 +1,3 @@
{
"<unk>": 32000
}

24
config.json Normal file
View File

@@ -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
}

7
generation_config.json Normal file
View File

@@ -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"
}

3
pytorch_model.bin Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d7087bfca003c9e2f7295a6a1550795848770f88af5c034ae6876ce06be9216
size 26953778121

6
special_tokens_map.json Normal file
View File

@@ -0,0 +1,6 @@
{
"bos_token": "<s>",
"eos_token": "</s>",
"pad_token": "<unk>",
"unk_token": "<unk>"
}

BIN
tokenizer.model (Stored with Git LFS) Normal file

Binary file not shown.

36
tokenizer_config.json Normal file
View File

@@ -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
}