devAnurag commited on
Commit
f63ac44
Β·
verified Β·
1 Parent(s): 294cdbf

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -0
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ## πŸš€ Capabilities
12
+
13
+ - βœ“ Financial Q&A
14
+ - βœ“ Balance sheet understanding
15
+ - βœ“ Profit/Loss interpretation
16
+ - βœ“ Ratios / EBITDA / EPS explanation
17
+ - βœ“ Market news reasoning
18
+ - βœ“ Risk assessment
19
+ - βœ“ Investment style suggestions
20
+ - βœ“ Banking & loan related Q&A
21
+
22
+ This model is optimized for **Indian finance use cases**.
23
+
24
+ ---
25
+
26
+ ## πŸ“Š Training Details
27
+
28
+ | Setting | Value |
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
+ Purpose:
38
+ To create a small lightweight but finance-aware LLM for **startups, fintech apps, compliance tools, and internal company use**.
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
+ ## 🧩 Model Architecture
56
+
57
+ Based on Phi-3 mini (3.8B parameters) with LoRA applied to:
58
+
59
+ - Self-attention QKV projections
60
+ - Output projections
61
+ - MLP up/down projections
62
+
63
+ Merged model = pure FP16 weights β†’ **No LoRA needed at inference**.
64
+
65
+ ---
66
+
67
+ ## πŸ’‘ Usage Example
68
+
69
+ ```python
70
+ from transformers import AutoModelForCausalLM, AutoTokenizer
71
+ import torch
72
+
73
+ model_id = "devAnurag/finance_llm_full"
74
+
75
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
76
+ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
77
+
78
+ prompt = "Explain EBITDA in simple terms."
79
+ inputs = tokenizer(prompt, return_tensors="pt")
80
+
81
+ outputs = model.generate(**inputs, max_new_tokens=150)
82
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))