Upload folder using huggingface_hub
Browse files- README.md +72 -0
- requirements.txt +5 -0
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🧠 Financial Literacy Quiz — Smart Money Assistant
|
| 2 |
+
|
| 3 |
+
This project is an AI-powered financial literacy quiz designed to help users build better money habits through realistic scenarios and immediate feedback.
|
| 4 |
+
|
| 5 |
+
The assistant, named **Smart Money**, is powered by a fine-tuned [Phi-2](https://huggingface.co/microsoft/phi-2) model using LoRA (Low-Rank Adaptation). It evaluates your financial decisions and gives witty, sharp explanations when your choices fall short.
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## 📦 Included
|
| 10 |
+
|
| 11 |
+
- `cli_quiz.py` — Command-line script to run the quiz
|
| 12 |
+
- `quiz_ready_dataset.jsonl` — A custom dataset of 1000+ realistic financial scenarios
|
| 13 |
+
- `model/` — Fine-tuned Phi-2 model directory (LoRA-merged or base)
|
| 14 |
+
- `README.md` — Project documentation
|
| 15 |
+
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
## 🚀 Quick Start
|
| 19 |
+
|
| 20 |
+
To run the quiz locally:
|
| 21 |
+
|
| 22 |
+
\`\`\`bash
|
| 23 |
+
pip install torch transformers
|
| 24 |
+
python3 cli_quiz.py
|
| 25 |
+
\`\`\`
|
| 26 |
+
|
| 27 |
+
> Note: If you are not using a GPU, modify the script to use `torch.float32` instead of `torch.float16`.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## 💡 How It Works
|
| 32 |
+
|
| 33 |
+
1. You’ll be asked 5 randomly selected financial scenario questions.
|
| 34 |
+
2. Choose your best response (multiple choice: a, b, or c).
|
| 35 |
+
3. If you’re wrong, Smart Money replies with a witty one-liner.
|
| 36 |
+
4. At the end, you receive a final score and personalized summary.
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## 🧠 Model Details
|
| 41 |
+
|
| 42 |
+
- **Base Model**: [Phi-2 by Microsoft](https://huggingface.co/microsoft/phi-2)
|
| 43 |
+
- **Fine-Tuning Method**: LoRA via `peft`
|
| 44 |
+
- **Libraries Used**: `transformers`, `torch`, `json`, `random`
|
| 45 |
+
- **Inference**: Local GPU (tested on 2x RTX 4080)
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## 🤖 Why This Matters
|
| 50 |
+
|
| 51 |
+
Many people lack access to practical, relatable financial education. This project bridges that gap by:
|
| 52 |
+
|
| 53 |
+
- Using an LLM to simulate a sharp financial coach
|
| 54 |
+
- Teaching through interactive, contextual scenarios
|
| 55 |
+
- Reinforcing good financial habits with real-time feedback
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## ✍️ Created By
|
| 60 |
+
|
| 61 |
+
[@lilbablo](https://huggingface.co/lilbablo) — exploring the intersection of AI, financial literacy, and interactive learning.
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
|
| 65 |
+
## 🤝 Contribute
|
| 66 |
+
|
| 67 |
+
Pull requests welcome! You can:
|
| 68 |
+
|
| 69 |
+
- Add more scenario questions
|
| 70 |
+
- Improve model responses
|
| 71 |
+
- Port this to Gradio or Streamlit
|
| 72 |
+
- Translate the quiz for international use
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch>=2.0.0
|
| 2 |
+
transformers>=4.36.0
|
| 3 |
+
peft>=0.8.0
|
| 4 |
+
accelerate>=0.24.0
|
| 5 |
+
bitsandbytes>=0.41.0
|