File size: 1,794 Bytes
0705bfe
 
ba62aa1
 
 
0705bfe
 
 
 
ba62aa1
0705bfe
 
 
ba62aa1
 
1ef3325
 
ba62aa1
 
 
 
1ef3325
 
 
 
ba62aa1
 
 
f8da064
 
 
 
 
 
 
 
 
ba62aa1
74709ca
 
ba62aa1
 
 
1ef3325
 
 
 
 
 
 
 
 
 
 
f8da064
1ef3325
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: Learnloop
emoji: 🔢💡
colorFrom: blue
colorTo: blue
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
short_description: AI tutor for math learners
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

## LearnLoop - AI Tutor for math 🔢💡
  LearnLoop is a lightweight AI-powered math tutor built with Gradio, SymPy, and Transformers. 
  It explains mathematical questions at different skill levels and verifies expressions using symbolic computation.

## Features
- Step-by-step explanations for math expressions
- Beginner, Intermediate, and Advanced levels
- Automatic math verification using `SymPy`
- Powered by Qwen2.5-1.5B-Instruct
- Clean, responsive UI with soft visual rhythm and microinteractions
- Keyboard support


## Getting started
1. Clone the repository  
  ```git clone https://github.com/your-username/learnloop.git```  
  ```cd learnloop```

2. Install dependencies  
  ```pip install -r requirements.txt```

3. Run the app  
  ```python app.py```

4. Turn on the light mode on your browser

## Requirements
See `requirements.txt` for full list

## Explanation logic
- Uses Qwen2.5-1.5B-Instruct via HuggingFace Transformers
- Prompt includes:
  - System messge to guide tone
  - Dynamic style string based on level and step-by-step toggle
  - User question
- Response is trimmed to remove artifacts
  
## UI Design
- Built with `gr.Blocks()`for modular layout
- Styled using embedded CSS via `gr.HTML()`
- `.gradio-container` to add color to the background
- Buttons styled with hover, focus and click effects
- Markdown used for instructions and output display

## Output format
- Explanation from the model
- Divider line
- `SymPy`verification result
- Status note (e.g. Transformers CPU)