Text Generation
Transformers
Safetensors
English
qwen2
finance
financial-qa
qlora
unsloth
qwen2.5
quantitative
conversational
text-generation-inference
Instructions to use sriksven/FinanceForge-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sriksven/FinanceForge-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sriksven/FinanceForge-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sriksven/FinanceForge-8b") model = AutoModelForCausalLM.from_pretrained("sriksven/FinanceForge-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use sriksven/FinanceForge-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sriksven/FinanceForge-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sriksven/FinanceForge-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sriksven/FinanceForge-8b
- SGLang
How to use sriksven/FinanceForge-8b 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 "sriksven/FinanceForge-8b" \ --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": "sriksven/FinanceForge-8b", "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 "sriksven/FinanceForge-8b" \ --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": "sriksven/FinanceForge-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use sriksven/FinanceForge-8b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sriksven/FinanceForge-8b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sriksven/FinanceForge-8b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sriksven/FinanceForge-8b to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="sriksven/FinanceForge-8b", max_seq_length=2048, ) - Docker Model Runner
How to use sriksven/FinanceForge-8b with Docker Model Runner:
docker model run hf.co/sriksven/FinanceForge-8b
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 4 |
+
tags:
|
| 5 |
+
- finance
|
| 6 |
+
- financial-qa
|
| 7 |
+
- qlora
|
| 8 |
+
- unsloth
|
| 9 |
+
- qwen2.5
|
| 10 |
+
- quantitative
|
| 11 |
+
datasets:
|
| 12 |
+
- TheFinAI/flare-finqa
|
| 13 |
+
- sujet-ai/Sujet-Finance-Instruct-177k
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
library_name: transformers
|
| 18 |
+
model-index:
|
| 19 |
+
- name: krishna-finance-7b
|
| 20 |
+
results: []
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# krishna-finance-7b
|
| 24 |
+
|
| 25 |
+
A fine-tuned **Qwen2.5-7B-Instruct** model specialized for **financial question answering and quantitative reasoning**. Trained on a combination of financial QA and instruction-following datasets to handle earnings analysis, ratio calculations, financial statement interpretation, and investment reasoning.
|
| 26 |
+
|
| 27 |
+
## Key Details
|
| 28 |
+
|
| 29 |
+
| | |
|
| 30 |
+
|---|---|
|
| 31 |
+
| **Base model** | Qwen/Qwen2.5-7B-Instruct |
|
| 32 |
+
| **Method** | QLoRA (4-bit NF4, rank 16, alpha 16) |
|
| 33 |
+
| **Library** | Unsloth + TRL SFTTrainer |
|
| 34 |
+
| **Datasets** | TheFinAI/flare-finqa (5K) + Sujet-Finance-Instruct-177k (5K) |
|
| 35 |
+
| **Total examples** | 10,000 |
|
| 36 |
+
| **Hardware** | NVIDIA RTX A5000 (24GB VRAM) on RunPod |
|
| 37 |
+
| **Training time** | ~2.75 hours |
|
| 38 |
+
| **Parameters trained** | 40.4M of 7.66B (0.53%) |
|
| 39 |
+
| **Format** | ChatML (`<\|im_start\|>` / `<\|im_end\|>`) |
|
| 40 |
+
| **Output** | Merged 16-bit safetensors |
|
| 41 |
+
|
| 42 |
+
## Dataset Composition
|
| 43 |
+
|
| 44 |
+
The training data blends two complementary sources:
|
| 45 |
+
|
| 46 |
+
- **FinQA** (5,000 examples) β financial question answering requiring numerical reasoning over earnings reports, balance sheets, and financial tables. Teaches the model to extract numbers, perform calculations, and explain financial logic step by step.
|
| 47 |
+
|
| 48 |
+
- **Sujet Finance Instruct** (5,000 examples) β broad financial instruction data covering investment analysis, market concepts, risk assessment, portfolio management, and financial planning. Gives the model general financial fluency.
|
| 49 |
+
|
| 50 |
+
## Usage
|
| 51 |
+
|
| 52 |
+
### Transformers
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
+
|
| 57 |
+
model = AutoModelForCausalLM.from_pretrained("sriksven/krishna-finance-7b")
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained("sriksven/krishna-finance-7b")
|
| 59 |
+
|
| 60 |
+
messages = [
|
| 61 |
+
{
|
| 62 |
+
"role": "system",
|
| 63 |
+
"content": "You are a financial analyst. Answer questions about financial data with precise calculations and step-by-step reasoning.",
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"role": "user",
|
| 67 |
+
"content": "A company reported revenue of $120M and cost of goods sold of $75M. Operating expenses were $25M. Calculate the gross margin and operating margin.",
|
| 68 |
+
},
|
| 69 |
+
]
|
| 70 |
+
|
| 71 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
|
| 72 |
+
outputs = model.generate(inputs, max_new_tokens=512)
|
| 73 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
### Unsloth (faster inference)
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
from unsloth import FastLanguageModel
|
| 80 |
+
|
| 81 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 82 |
+
model_name="sriksven/krishna-finance-7b",
|
| 83 |
+
max_seq_length=2048,
|
| 84 |
+
load_in_4bit=True,
|
| 85 |
+
)
|
| 86 |
+
FastLanguageModel.for_inference(model)
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Example Capabilities
|
| 90 |
+
|
| 91 |
+
- **Financial ratio calculation** β gross margin, operating margin, ROE, P/E, debt-to-equity
|
| 92 |
+
- **Earnings analysis** β interpreting revenue trends, YoY growth, segment performance
|
| 93 |
+
- **Financial statement reading** β balance sheet, income statement, cash flow analysis
|
| 94 |
+
- **Investment reasoning** β valuation approaches, risk factors, portfolio considerations
|
| 95 |
+
- **Quantitative QA** β multi-step numerical reasoning over financial data
|
| 96 |
+
|
| 97 |
+
## Intended Use
|
| 98 |
+
|
| 99 |
+
- Financial question answering systems
|
| 100 |
+
- Building finance-focused chatbots or copilots
|
| 101 |
+
- Quantitative analysis assistants for analysts and students
|
| 102 |
+
- Research on domain-specific LLM fine-tuning in finance
|
| 103 |
+
|
| 104 |
+
## Limitations
|
| 105 |
+
|
| 106 |
+
- Not a financial advisor β outputs should not be used as investment advice
|
| 107 |
+
- Trained on English-language financial data only
|
| 108 |
+
- May hallucinate financial figures not present in the input context
|
| 109 |
+
- No real-time market data access β knowledge limited to training data patterns
|
| 110 |
+
- Not evaluated against established financial NLP benchmarks (FinQA leaderboard, etc.)
|
| 111 |
+
- Best results when using the system prompt format matching training
|
| 112 |
+
|
| 113 |
+
## Training Infrastructure
|
| 114 |
+
|
| 115 |
+
| | |
|
| 116 |
+
|---|---|
|
| 117 |
+
| **GPU** | NVIDIA RTX A5000 24GB |
|
| 118 |
+
| **Cloud** | RunPod ($0.27/hr) |
|
| 119 |
+
| **Framework** | Unsloth 2026.5.2 + TRL + Transformers 5.5.0 |
|
| 120 |
+
| **Precision** | BF16 training, 4-bit NF4 base quantization |
|
| 121 |
+
| **Optimizer** | AdamW 8-bit |
|
| 122 |
+
| **Learning rate** | 2e-4, linear decay |
|
| 123 |
+
| **Batch size** | 16 effective (4 per device Γ 4 accumulation) |
|
| 124 |
+
| **Packing** | Enabled |
|
| 125 |
+
|
| 126 |
+
## Source Code
|
| 127 |
+
|
| 128 |
+
Training scripts and configs: [github.com/sriksven/LLM-FineTune-Suite](https://github.com/sriksven/LLM-FineTune-Suite)
|
| 129 |
+
|
| 130 |
+
## License
|
| 131 |
+
|
| 132 |
+
Apache 2.0
|