File size: 1,966 Bytes
90483d4
bd1a8eb
 
 
90483d4
bd1a8eb
 
 
 
 
 
 
 
 
 
 
90483d4
 
 
 
 
 
 
 
bd1a8eb
05e9366
bd1a8eb
05e9366
 
 
 
 
 
 
4535a7d
 
 
177e4d6
4535a7d
 
 
 
78ac027
bd1a8eb
78ac027
 
 
 
 
 
 
 
 
 
9c345b2
 
 
41def71
 
78ac027
9c345b2
 
4535a7d
05e9366
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
base_model: mlx-community/Qwen2.5-3B-Instruct-4bit
language:
- en
license: apache-2.0
license_name: qwen-research
license_link: https://huggingface.co/Qwen/Qwen2.5-3B-Instruct/blob/main/LICENSE
pipeline_tag: text-generation
tags:
- finance
- financial-analysis
- mlx
- qlora
- transformers
- qwen
library_name: mlx
datasets:
- FinanceMTEB/financial_phrasebank
- ChanceFocus/flare-finqa
- ChanceFocus/flare-convfinqa
- ChanceFocus/flare-tatqa
- ChanceFocus/flare-headlines
- ChanceFocus/flare-ner
- gbharti/finance-alpaca
---
# Qwen 2.5 3B QLoRA — Financial Reasoning Model

A fine-tuned version of Qwen 2.5 3B specialized in financial calculations
(EBIT, EBITDA, EBITDAR) and multi-step numerical reasoning over structured inputs.

---


## Quick Start

### Install
```bash
pip install mlx-lm
```

### Run Inference
```python
from mlx_lm import load, stream_generate

model, tokenizer = load("rohan-bansode/Qwen-2.5-3B-QLORA")

prompt = """
Analyze:
Revenue = 500k
Operating Expenses = 350k
Rent = 50k

Calculate EBITDAR and explain.
"""

stop_sequences = ["<|endoftext|>", "<|im_end|>", "Human:", "Assistant:"]

print("--- Financial Sandbox Output ---")

for response in stream_generate(model, tokenizer, prompt, max_tokens=512):
    if any(stop in response.text for stop in stop_sequences):
        break
    print(response.text, end="", flush=True)
```
## Example Output

```text
EBITDAR = 200k

Explanation:
EBITDAR = Revenue - Operating Expenses + Rent
= 500k - 350k + 50k = 200k
```

## What this model is good at

- Financial reasoning (EBIT, EBITDA, EBITDAR)
- Multi-step numerical calculations
- Structured financial Q&A

## Limitations

- Not reliable for real financial decisions
- Can make calculation mistakes if prompt is unclear
- Limited context (~1.5k tokens)

## Improvements over base model

- More consistent financial calculations
- Better step-by-step reasoning for numerical tasks
- Reduced hallucination in structured financial prompts