Instructions to use AgenticFinLab/PyFi-QwenVL-3B-COT-47K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AgenticFinLab/PyFi-QwenVL-3B-COT-47K with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("/home/yuxuanzhao/LLaMA-Factory/models/qwen2_5-vl-3B-Instruct") model = PeftModel.from_pretrained(base_model, "AgenticFinLab/PyFi-QwenVL-3B-COT-47K") - Transformers
How to use AgenticFinLab/PyFi-QwenVL-3B-COT-47K with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AgenticFinLab/PyFi-QwenVL-3B-COT-47K") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AgenticFinLab/PyFi-QwenVL-3B-COT-47K", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AgenticFinLab/PyFi-QwenVL-3B-COT-47K with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AgenticFinLab/PyFi-QwenVL-3B-COT-47K" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AgenticFinLab/PyFi-QwenVL-3B-COT-47K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AgenticFinLab/PyFi-QwenVL-3B-COT-47K
- SGLang
How to use AgenticFinLab/PyFi-QwenVL-3B-COT-47K 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 "AgenticFinLab/PyFi-QwenVL-3B-COT-47K" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AgenticFinLab/PyFi-QwenVL-3B-COT-47K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "AgenticFinLab/PyFi-QwenVL-3B-COT-47K" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AgenticFinLab/PyFi-QwenVL-3B-COT-47K", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AgenticFinLab/PyFi-QwenVL-3B-COT-47K with Docker Model Runner:
docker model run hf.co/AgenticFinLab/PyFi-QwenVL-3B-COT-47K
Improve model card and metadata
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,208 +1,67 @@
|
|
| 1 |
---
|
| 2 |
base_model: Qwen/Qwen2.5-VL-3B-Instruct
|
| 3 |
library_name: peft
|
| 4 |
-
pipeline_tag: text-
|
|
|
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
- llama-factory
|
| 8 |
- lora
|
| 9 |
-
-
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 15 |
-
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
## Model Details
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
- **
|
| 27 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 28 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 29 |
-
- **Model type:** [More Information Needed]
|
| 30 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 31 |
-
- **License:** [More Information Needed]
|
| 32 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 33 |
-
|
| 34 |
-
### Model Sources [optional]
|
| 35 |
-
|
| 36 |
-
<!-- Provide the basic links for the model. -->
|
| 37 |
-
|
| 38 |
-
- **Repository:** [More Information Needed]
|
| 39 |
-
- **Paper [optional]:** [More Information Needed]
|
| 40 |
-
- **Demo [optional]:** [More Information Needed]
|
| 41 |
-
|
| 42 |
-
## Uses
|
| 43 |
-
|
| 44 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 45 |
-
|
| 46 |
-
### Direct Use
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Downstream Use [optional]
|
| 53 |
-
|
| 54 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
### Out-of-Scope Use
|
| 59 |
-
|
| 60 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
-
|
| 64 |
-
## Bias, Risks, and Limitations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 75 |
-
|
| 76 |
-
## How to Get Started with the Model
|
| 77 |
-
|
| 78 |
-
Use the code below to get started with the model.
|
| 79 |
-
|
| 80 |
-
[More Information Needed]
|
| 81 |
|
| 82 |
## Training Details
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 112 |
-
|
| 113 |
-
### Testing Data, Factors & Metrics
|
| 114 |
-
|
| 115 |
-
#### Testing Data
|
| 116 |
-
|
| 117 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Factors
|
| 122 |
-
|
| 123 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
#### Metrics
|
| 128 |
-
|
| 129 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 130 |
-
|
| 131 |
-
[More Information Needed]
|
| 132 |
-
|
| 133 |
-
### Results
|
| 134 |
-
|
| 135 |
-
[More Information Needed]
|
| 136 |
-
|
| 137 |
-
#### Summary
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
## Model Examination [optional]
|
| 142 |
-
|
| 143 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 144 |
-
|
| 145 |
-
[More Information Needed]
|
| 146 |
-
|
| 147 |
-
## Environmental Impact
|
| 148 |
-
|
| 149 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 150 |
-
|
| 151 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 152 |
-
|
| 153 |
-
- **Hardware Type:** [More Information Needed]
|
| 154 |
-
- **Hours used:** [More Information Needed]
|
| 155 |
-
- **Cloud Provider:** [More Information Needed]
|
| 156 |
-
- **Compute Region:** [More Information Needed]
|
| 157 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 158 |
-
|
| 159 |
-
## Technical Specifications [optional]
|
| 160 |
-
|
| 161 |
-
### Model Architecture and Objective
|
| 162 |
-
|
| 163 |
-
[More Information Needed]
|
| 164 |
-
|
| 165 |
-
### Compute Infrastructure
|
| 166 |
-
|
| 167 |
-
[More Information Needed]
|
| 168 |
-
|
| 169 |
-
#### Hardware
|
| 170 |
-
|
| 171 |
-
[More Information Needed]
|
| 172 |
-
|
| 173 |
-
#### Software
|
| 174 |
-
|
| 175 |
-
[More Information Needed]
|
| 176 |
-
|
| 177 |
-
## Citation [optional]
|
| 178 |
-
|
| 179 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 180 |
-
|
| 181 |
-
**BibTeX:**
|
| 182 |
-
|
| 183 |
-
[More Information Needed]
|
| 184 |
-
|
| 185 |
-
**APA:**
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## Glossary [optional]
|
| 190 |
-
|
| 191 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 192 |
-
|
| 193 |
-
[More Information Needed]
|
| 194 |
-
|
| 195 |
-
## More Information [optional]
|
| 196 |
-
|
| 197 |
-
[More Information Needed]
|
| 198 |
-
|
| 199 |
-
## Model Card Authors [optional]
|
| 200 |
-
|
| 201 |
-
[More Information Needed]
|
| 202 |
-
|
| 203 |
-
## Model Card Contact
|
| 204 |
-
|
| 205 |
-
[More Information Needed]
|
| 206 |
-
### Framework versions
|
| 207 |
-
|
| 208 |
-
- PEFT 0.17.1
|
|
|
|
| 1 |
---
|
| 2 |
base_model: Qwen/Qwen2.5-VL-3B-Instruct
|
| 3 |
library_name: peft
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
license: apache-2.0
|
| 6 |
tags:
|
| 7 |
+
- finance
|
|
|
|
| 8 |
- lora
|
| 9 |
+
- vision-language
|
| 10 |
+
- qwen
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# PyFi-QwenVL-3B-47K
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
This model is a fine-tuned LoRA adapter for [Qwen2.5-VL-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct), specialized for financial image understanding. It was introduced as part of the PyFi framework.
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
|
| 19 |
+
- **Developed by:** Yuqun Zhang, Yuxuan Zhao, Sijia Chen (AgenticFinLab)
|
| 20 |
+
- **Model type:** Vision-Language Model (LoRA Adapter)
|
| 21 |
+
- **Base Model:** [Qwen/Qwen2.5-VL-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct)
|
| 22 |
+
- **Language(s):** English
|
| 23 |
+
- **License:** Apache 2.0
|
| 24 |
+
- **Paper:** [PyFi: Toward Pyramid-like Financial Image Understanding for VLMs via Adversarial Agents](https://arxiv.org/abs/2512.14735)
|
| 25 |
+
- **Repository:** [https://github.com/AgenticFinLab/PyFi](https://github.com/AgenticFinLab/PyFi)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
## Summary
|
| 28 |
|
| 29 |
+
PyFi (Pyramid-like Financial Image Understanding) is a framework designed to enhance Visual Language Models (VLMs) in understanding complex financial images through adversarial agents. The framework enables VLMs to reason through question chains in a progressive, simple-to-complex manner across six hierarchical capability levels:
|
| 30 |
+
1. **Perception**: Basic visual understanding
|
| 31 |
+
2. **Data Extraction**: Foundational information retrieval
|
| 32 |
+
3. **Calculation Analysis**: Numerical analysis tasks
|
| 33 |
+
4. **Pattern Recognition**: Identifying trends and patterns
|
| 34 |
+
5. **Logical Reasoning**: Complex logical analysis
|
| 35 |
+
6. **Decision Support**: Strategic decision-making assistance
|
| 36 |
|
| 37 |
+
This specific checkpoint was fine-tuned on approximately 47,000 question-answer chains from the **PyFi-600K** dataset. In this version ("w/o CoT"), only the question and answer from the final sample in each chain were used during training to target the ultimate reasoning goal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Training Details
|
| 40 |
|
| 41 |
+
The model was fine-tuned with the following configuration:
|
| 42 |
+
- **Optimizer**: AdamW
|
| 43 |
+
- **Learning Rate**: $1.0 \times 10^{-4}$
|
| 44 |
+
- **Learning Rate Schedule**: Cosine scheduling with warmup ratio of 0.1
|
| 45 |
+
- **Training Epochs**: 1
|
| 46 |
+
- **Batch Size**: Effective batch size of 8
|
| 47 |
+
- **PEFT**: LoRA with full-module adaptation
|
| 48 |
+
- **Hardware**: 4x NVIDIA RTX 5090 GPUs
|
| 49 |
+
|
| 50 |
+
## Citation
|
| 51 |
+
|
| 52 |
+
If you use PyFi in your research, please cite:
|
| 53 |
+
|
| 54 |
+
```bibtex
|
| 55 |
+
@article{pyfi2025,
|
| 56 |
+
title={PyFi: Toward Pyramid-like Financial Image Understanding for VLMs via Adversarial Agents},
|
| 57 |
+
author={Zhang, Yuqun and Zhao, Yuxuan and Chen, Sijia},
|
| 58 |
+
journal={arXiv preprint arXiv:2512.14735},
|
| 59 |
+
year={2025}
|
| 60 |
+
}
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## Contact
|
| 64 |
+
|
| 65 |
+
For questions or inquiries, please contact:
|
| 66 |
+
- **Email**: Yuqun Zhang ([research@yuqunzhang.com](mailto:research@yuqunzhang.com)) or Yuxuan Zhao ([yx.zhao129@gmail.com](mailto:yx.zhao129@gmail.com))
|
| 67 |
+
- **GitHub Issues**: [https://github.com/AgenticFinLab/PyFi/issues](https://github.com/AgenticFinLab/PyFi/issues)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|