CoolFace
Apppublic

AlphJain/math-problem-solver

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
README.md101 linesDownload Raw Back to root
1---2title: Math Problem Solver3emoji: ๐Ÿงฎ4colorFrom: blue5colorTo: indigo6sdk: streamlit7sdk_version: "1.32.2"8app_file: app.py9pinned: false10---11 12# ๐Ÿงฎ Math Problem Solver13 14## Overview15 16Math Problem Solver is an AI-powered Streamlit application that helps users solve mathematical problems with step-by-step explanations. The application uses Groq's AI models (including Google Gemma 2) to provide detailed solutions to a wide range of mathematical topics.17 18## Getting Started19 20### Prerequisites21 22- Python 3.8+23- Groq API key (get one at [console.groq.com](https://console.groq.com/keys))24 25### Installation26 271. Clone this repository:28   ```bash29   git clone https://github.com/yourusername/math-problem-solver.git30   cd math-problem-solver31   ```32 332. Install dependencies:34   ```bash35   pip install -r requirements.txt36   ```37 383. Create a `.env` file in the project root and add your Groq API key:39   ```40   GROQ_API_KEY=your_api_key_here41   ```42 434. Run the application:44   ```bash45   streamlit run app.py46   ```47 485. Open your browser and navigate to `http://localhost:8501`49 50## Usage51 521. Enter your Groq API key in the sidebar (if not already set in `.env`)532. Select your preferred AI model543. Type your math problem in the text area or choose from the example problems554. Click "Solve Problem" to get a detailed solution565. Review the step-by-step explanation57 58### Example Problems59 60- Solve for x: 2x + 5 = 1561- Find the area of a circle with radius 4 cm62- If a train travels at 60 mph and takes 3 hours to reach its destination, how far did it travel?63- Word problems involving multiple operations and conversions64 65## Technical Details66 67This application uses:68 69- **Streamlit**: For the web interface70- **LangChain**: For agent orchestration and tool integration71- **Groq API**: For AI model inference72- **Google Gemma 2**: Primary AI model for solving math problems73- **Wikipedia API**: For foundational knowledge74- **arXiv API**: For academic mathematical concepts75- **DuckDuckGo Search**: For web search capabilities76 77The application uses a zero-shot agent that strategically chooses which tool to use based on the problem type.78 79## Advanced Configuration80 81In the "Advanced Options" section of the sidebar, you can:82 83- Adjust the temperature (creativity) of the AI responses84- Toggle the visibility of AI reasoning steps85- Select different models for different types of problems86 87## Development88 89### Project Structure90 91```92math-problem-solver/93โ”œโ”€โ”€ app.py                  # Main application file94โ”œโ”€โ”€ .env                    # Environment variables (git-ignored)95โ”œโ”€โ”€ requirements.txt        # Dependencies96โ”œโ”€โ”€ README.md               # Project documentation97โ”œโ”€โ”€ LICENSE                 # MIT License98โ”œโ”€โ”€ screenshots/            # App screenshots99โ”‚   โ””โ”€โ”€ app_screenshot.png  # Main app screenshot100โ””โ”€โ”€ .gitignore              # Git ignore configuration101```