README.md
Browse files
README.md
CHANGED
|
@@ -1,73 +1,72 @@
|
|
| 1 |
-
# π§ Finance LLM β Fine-Tuned Phi-3 Mini (LoRA + Full Merge)
|
| 2 |
-
|
| 3 |
-
This model is a **financial question-answering LLM**, fine-tuned on a curated dataset using:
|
| 4 |
-
|
| 5 |
-
- **Base Model:** microsoft/phi-3-mini-4k-instruct
|
| 6 |
-
- **Training Method:** LoRA (Rank=16, Alpha=32, Dropout=0.05)
|
| 7 |
-
- **Merged Model:** Yes (LoRA + Base fully merged into one model)
|
| 8 |
-
|
| 9 |
---
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
-
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
-
-
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
---
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
| Epochs | 2 |
|
| 31 |
-
| LoRA Rank | 16 |
|
| 32 |
-
| Batch Size | 2 |
|
| 33 |
-
| Learning Rate | 2e-4 |
|
| 34 |
-
| Dataset | FinanceQA (custom cleaned) |
|
| 35 |
-
| Hardware | A100 / T4 / Colab GPU |
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
## π Dataset
|
| 43 |
-
|
| 44 |
-
This model was trained on:
|
| 45 |
-
|
| 46 |
-
- Financial questions & answers
|
| 47 |
-
- Corporate filings
|
| 48 |
-
- Stock-market explanations
|
| 49 |
-
- Real-world financial reasoning examples
|
| 50 |
-
|
| 51 |
-
Dataset used: **AfterQuery/FinanceQA** (public)
|
| 52 |
|
| 53 |
---
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
-
|
| 60 |
-
-
|
| 61 |
-
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
---
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
```python
|
| 70 |
-
from transformers import
|
| 71 |
import torch
|
| 72 |
|
| 73 |
model_id = "devAnurag/finance_llm_full"
|
|
@@ -75,7 +74,7 @@ model_id = "devAnurag/finance_llm_full"
|
|
| 75 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 76 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
|
| 77 |
|
| 78 |
-
prompt = "Explain EBITDA
|
| 79 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 80 |
|
| 81 |
outputs = model.generate(**inputs, max_new_tokens=150)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- finance
|
| 5 |
+
- financial-qa
|
| 6 |
+
- finetuned-llm
|
| 7 |
+
- phi3
|
| 8 |
+
- phi-3-mini
|
| 9 |
+
- fintech
|
| 10 |
+
- accounting
|
| 11 |
+
- banking
|
| 12 |
+
- investment
|
| 13 |
+
- risk-analysis
|
| 14 |
+
- lora
|
| 15 |
+
- merged-model
|
| 16 |
+
language:
|
| 17 |
+
- en
|
| 18 |
+
pipeline_tag: text-generation
|
| 19 |
+
base_model: microsoft/phi-3-mini-4k-instruct
|
| 20 |
+
model_name: finance_llm_full
|
| 21 |
+
model_creator: devAnurag
|
| 22 |
+
pretty_name: Finance LLM Full
|
| 23 |
---
|
| 24 |
|
| 25 |
+
# π Finance LLM Full β Next-Gen Financial Intelligence Model
|
| 26 |
|
| 27 |
+
**Finance LLM Full** is a high-performance, fully merged financial Large Language Model (LLM)
|
| 28 |
+
designed to deliver **crystal-clear, accurate, and structured financial reasoning**.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
It is trained using **LoRA fine-tuning** on top of **Phi-3 Mini 4K Instruct**, and later
|
| 31 |
+
**merged into a single standalone model** for seamless deployment.
|
| 32 |
|
| 33 |
+
This model specializes in **Finance, Accounting, Banking, Investment, Stock Markets, and Business Analysis** β
|
| 34 |
+
making it ideal for **FinTech products, AI advisors, investment copilots, and enterprise bots**.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
---
|
| 37 |
|
| 38 |
+
# β‘ Why Finance LLM Full is Special
|
| 39 |
+
|
| 40 |
+
### πΉ 1. Purpose-Built For Finance
|
| 41 |
+
Unlike general LLMs, this model deeply understands:
|
| 42 |
+
- Balance Sheet Interpretation
|
| 43 |
+
- Profit & Loss Breakdown
|
| 44 |
+
- Cashflow Logic
|
| 45 |
+
- EBITDA / EPS / ROE / DCF
|
| 46 |
+
- Risk & Return Analysis
|
| 47 |
+
- Banking, Loans, Limits, Credit Rules
|
| 48 |
+
- Valuation Basics
|
| 49 |
+
- Investment & Portfolio Concepts
|
| 50 |
+
|
| 51 |
+
### πΉ 2. Merged Model β One File, Zero Hassle
|
| 52 |
+
β No LoRA needed
|
| 53 |
+
β No adapter loading
|
| 54 |
+
β Direct plug-and-play
|
| 55 |
+
β Works on CPU / GPU / Colab / Docker
|
| 56 |
+
|
| 57 |
+
### πΉ 3. Small Model β Big Capability
|
| 58 |
+
Powered by **Phi-3 Mini**, optimized for:
|
| 59 |
+
- Low latency
|
| 60 |
+
- Low VRAM/RAM usage
|
| 61 |
+
- Clean, structured answers
|
| 62 |
+
- High domain accuracy
|
| 63 |
|
| 64 |
---
|
| 65 |
|
| 66 |
+
# π§ͺ Quick Start (Copy & Run)
|
| 67 |
|
| 68 |
```python
|
| 69 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 70 |
import torch
|
| 71 |
|
| 72 |
model_id = "devAnurag/finance_llm_full"
|
|
|
|
| 74 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 75 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
|
| 76 |
|
| 77 |
+
prompt = "Explain the difference between EBITDA and Net Profit."
|
| 78 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 79 |
|
| 80 |
outputs = model.generate(**inputs, max_new_tokens=150)
|