Instructions to use TongjiFinLab/CFGPT1-pt-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TongjiFinLab/CFGPT1-pt-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TongjiFinLab/CFGPT1-pt-7B", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TongjiFinLab/CFGPT1-pt-7B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TongjiFinLab/CFGPT1-pt-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TongjiFinLab/CFGPT1-pt-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TongjiFinLab/CFGPT1-pt-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TongjiFinLab/CFGPT1-pt-7B
- SGLang
How to use TongjiFinLab/CFGPT1-pt-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TongjiFinLab/CFGPT1-pt-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TongjiFinLab/CFGPT1-pt-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "TongjiFinLab/CFGPT1-pt-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TongjiFinLab/CFGPT1-pt-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TongjiFinLab/CFGPT1-pt-7B with Docker Model Runner:
docker model run hf.co/TongjiFinLab/CFGPT1-pt-7B
| license: apache-2.0 | |
| language: | |
| - zh | |
| pipeline_tag: text-generation | |
| --- | |
| <div style="text-align:center"> | |
| <!-- <img src="https://big-cheng.com/k2/k2.png" alt="k2-logo" width="200"/> --> | |
| <h2>📈 CFGPT: Chinese Financial Assistant with Large Language Model (CFGPT1-pt-7b)</h2> | |
| </div> | |
| ## Introduction | |
| We introduce **CFGPT**, an open-source language model trained by firstly further pretraining general LLMs on collected and cleaned Chinese finance text data (CFData-pt), including financial domain-specific data (announcement, finance articles, finance exams, finance news, finance research papers) and general data (Wikipedia), and secondly fine-tuning with knowledge-intensive instruction tuning data (CFData-sft). | |
| As for preliminary evaluation, we use CFBenchmark-Basic. | |
| CFGPT outperforms the baselines on objective and subjective tasks compared to several baseline models with similar parameters. | |
| In this repository, we will share the further pretrained model. | |
| - [Pretrained Model](https://huggingface.co/TongjiFinLab/CFGPT1-pt-7B): Full model weights after further pretraining with the chinese finance text corpus to comply with the InternLM model license. | |
| ## How to Use | |
| The CFGPT1-pt-7b is a pre-trained model, which has not undergone supervised fine-tuning with a instruction data. Therefore, it is not advisable to use this model for financial tasks. | |
| Please refer to [CFGPT]() Github repo for further usage. | |
| ## 简介 | |
| **CFGPT**是一个开源的语言模型,首先通过在收集和清理的中国金融文本数据(CFData-pt)上进行继续预训练,包括金融领域特定数据(公告、金融文章、金融考试、金融新闻、金融研究论文)和通用数据(维基百科),然后使用知识密集的指导调整数据(CFData-sft)进行微调。 | |
| 我们使用CFBenchmark-Basic进行初步评估。与几个具有相似参数的基线模型相比,CFGPT在识别,分类和生成任务上表现优越。 | |
| 在这个仓库中,我们将分享以下继续预训练的模型。 | |
| - [Pretrained Model](https://huggingface.co/TongjiFinLab/CFGPT1-pt-7B): 在中国金融文本语料库上进行进一步预训练且符合InternLM模型许可的完整模型权重。 | |
| ## 如何使用 | |
| 这个模型是一个预训练的模型,还没有经历过指令数据库的有监督微调,因此不建议使用该模型执行相关金融任务。 | |
| 具体使用,请参考[CFGPT]()的Github仓库。 |