https://github.com/absarraashid3/sassysolver
SassySolver π€π - An AI-powered tool that humorously corrects wrong math memes! Built with a fine-tuned Qwen1.5-4B-Chat model using LoRA, deployed via Streamlit. It identifies common math misconceptions and provides accurate, sassy explanations. Make math memes smarter, one joke at a time!
https://github.com/absarraashid3/sassysolver
artificial-intelligence fine-tuning generative-ai lora machine-learning nlp-machine-learning qlora qwen streamlit
Last synced: about 1 month ago
JSON representation
SassySolver π€π - An AI-powered tool that humorously corrects wrong math memes! Built with a fine-tuned Qwen1.5-4B-Chat model using LoRA, deployed via Streamlit. It identifies common math misconceptions and provides accurate, sassy explanations. Make math memes smarter, one joke at a time!
- Host: GitHub
- URL: https://github.com/absarraashid3/sassysolver
- Owner: AbsarRaashid3
- Created: 2025-03-22T10:11:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-22T10:36:15.000Z (7 months ago)
- Last Synced: 2025-06-17T22:42:17.872Z (4 months ago)
- Topics: artificial-intelligence, fine-tuning, generative-ai, lora, machine-learning, nlp-machine-learning, qlora, qwen, streamlit
- Language: Jupyter Notebook
- Homepage: https://medium.com/@absarrashid3/sassysolver-the-ai-that-roasts-wrong-math-memes-1a98b40c1a12
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SassySolver π€π - Correcting Wrong Math Memes with AI
SassySolver is a fun and educational AI-powered project designed to correct incorrect math memes and provide accurate explanations. By using a fine-tuned Qwen1.5-4B-Chat model, SassySolver aims to address common math misconceptions and errors with sass and precision.
## π Overview
### SassySolver is built with the following features:- Fine-tuned Qwen1.5-4B-Chat model using LoRA (Low-Rank Adaptation) technique.
- Memory-efficient quantization using bitsandbytes.
- Model deployment via Streamlit with an interactive UI.
- Trained on a diverse dataset of incorrect math memes and correct explanations.
- Provides entertaining yet informative explanations for a wide variety of math-related mistakes.## π Directory Structure
```
βββ math_memes_dataset123.csv # Dataset for training the model
βββ app.py # Streamlit deployment script
βββ your_script.py # Script for testing the model with new inputs
βββ requirements.txt # Dependencies for the project
βββ Output.png # Sample output of the model
βββ Output2.png # Sample output of the model
βββ Output3.png # Sample output of the model
βββ README.md # Project README (this file)
```## π Installation
**To get started, clone this repository and install the required packages:**
```
git clone https://github.com/AbsarRaashid3/SassySolver.git
cd SassySolver
```**Install the dependencies from requirements.txt:I**
```
pip install -r requirements.txt
```## π Dataset
The dataset (math_memes_dataset123.csv) consists of pairs of incorrect math memes and their corresponding correct explanations. Example entries:
```
input,output
8 Γ· 2(2+2) = 1?,Incorrect! Correct solution: 8 Γ· 2Γ(2+2) = 8 Γ· 2Γ4 = 4Γ4 = 16. PEMDAS requires performing multiplication and division leftβtoβright after parentheses.
1/2 + 1/3 = 2/5. Just add numerators and denominators!,Fraction error! The correct method is to find a common denominator: 1/2 = 3/6 and 1/3 = 2/6; so the sum is 5/6.```
## π§© Model Training
**The model is fine-tuned using LoRA (Low-Rank Adaptation) with quantization enabled to reduce memory usage. The training script is written in Jupyter Notebook.**### Training Configuration
- Model: Qwen1.5-4B-Chat
- LoRA Configuration: r=16, lora_alpha=16, lora_dropout=0.05
- Quantization: 4-bit quantization using BitsAndBytesConfig
- Training Epochs: 9
- Evaluation Strategy: epoch
- Optimized for both GPU and CPU compatibility.## π Deployment
The model is deployed using Streamlit with app.py.## Run the App Locally
```
streamlit run app.py
```Once deployed, the UI will be accessible at:
```
http://localhost:8501
```## Ngrok Deployment (Optional)
If you want to make your app publicly accessible, you can use ngrok.```
ngrok authtoken YOUR_NGROK_AUTH_TOKEN # Set your ngrok auth token
```Then, in your terminal:
```
python -m streamlit run app.py
```## π Usage
- Open the Streamlit app.
- Enter a wrong math meme.
- Click "Fix Math Meme" button.
- Receive a corrected explanation with a touch of sass!## π¦ Requirements
The required packages are listed in the requirements.txt file:
```
torch
streamlit
datasets
transformers
bitsandbytes
```Install them using:
```
pip install -r requirements.txt
```## π Testing The Model
Use the your_script.py file to test the model with more incorrect math memes.```
python your_script.py
```## π· Sample Outputs


## π₯ Future Improvements
- Enhancing the dataset with more common misconceptions.
- Improving the UI for better user experience.
- Deploying the model as a web API for easier integration.## π¬ Acknowledgments
**Special thanks to the developers of Qwen1.5-4B-Chat, Streamlit, and bitsandbytes for making this project possible.**