Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,6 @@ def generate_problems(topic, num_problems):
|
|
| 15 |
Format:
|
| 16 |
Problem 1: [clear problem statement]
|
| 17 |
Problem 2: [clear problem statement]
|
| 18 |
-
...
|
| 19 |
|
| 20 |
Make them educational and challenging."""
|
| 21 |
|
|
@@ -31,63 +30,12 @@ Make them educational and challenging."""
|
|
| 31 |
demo = gr.Interface(
|
| 32 |
fn=generate_problems,
|
| 33 |
inputs=[
|
| 34 |
-
gr.Textbox(label="
|
| 35 |
-
gr.Slider(1, 10, value=3, step=1, label="
|
| 36 |
],
|
| 37 |
-
outputs=gr.Textbox(label="
|
| 38 |
-
title="
|
| 39 |
description="Generate math problems using AI"
|
| 40 |
)
|
| 41 |
|
| 42 |
-
demo.launch()
|
| 43 |
-
```
|
| 44 |
-
|
| 45 |
-
5. לחץ **"Commit new file to main"** (למטה)
|
| 46 |
-
|
| 47 |
-
---
|
| 48 |
-
|
| 49 |
-
## 📋 שלב 4: צור קובץ `requirements.txt`
|
| 50 |
-
|
| 51 |
-
1. שוב לחץ **"+ Add file" → "Create a new file"**
|
| 52 |
-
2. שם הקובץ: **`requirements.txt`**
|
| 53 |
-
3. העתק את זה:
|
| 54 |
-
```
|
| 55 |
-
transformers
|
| 56 |
-
torch
|
| 57 |
-
accelerate
|
| 58 |
-
gradio
|
| 59 |
-
```
|
| 60 |
-
|
| 61 |
-
4. לחץ **"Commit new file to main"**
|
| 62 |
-
|
| 63 |
-
---
|
| 64 |
-
|
| 65 |
-
## ⏳ שלב 5: המתן לבנייה
|
| 66 |
-
|
| 67 |
-
- Hugging Face יתחיל לבנות את ה-Space אוטומטית
|
| 68 |
-
- תראה **"Building"** או **"Running"** בראש העמוד
|
| 69 |
-
- זה לוקח **3-5 דקות** בפעם הראשונה
|
| 70 |
-
|
| 71 |
-
---
|
| 72 |
-
|
| 73 |
-
## ✅ שלב 6: ה-Space מוכן!
|
| 74 |
-
|
| 75 |
-
כשזה מוכן תראה:
|
| 76 |
-
- ✅ **"Running"** בירוק
|
| 77 |
-
- ממשק עם שדות קלט
|
| 78 |
-
- כפתור **"Submit"**
|
| 79 |
-
|
| 80 |
-
**עכשיו אתה יכול:**
|
| 81 |
-
1. להכניס נושא (למשל "algebra")
|
| 82 |
-
2. לבחור מספר שאלות
|
| 83 |
-
3. ללחוץ Submit
|
| 84 |
-
4. לחכות 20-30 שניות
|
| 85 |
-
5. לקבל שאלות! 🎉
|
| 86 |
-
|
| 87 |
-
---
|
| 88 |
-
|
| 89 |
-
## 🔍 איפה לראות את ה-Space?
|
| 90 |
-
|
| 91 |
-
הכתובת תהיה:
|
| 92 |
-
```
|
| 93 |
-
https://huggingface.co/spaces/[שם-המשתמש-שלך]/math-problem-generator
|
|
|
|
| 15 |
Format:
|
| 16 |
Problem 1: [clear problem statement]
|
| 17 |
Problem 2: [clear problem statement]
|
|
|
|
| 18 |
|
| 19 |
Make them educational and challenging."""
|
| 20 |
|
|
|
|
| 30 |
demo = gr.Interface(
|
| 31 |
fn=generate_problems,
|
| 32 |
inputs=[
|
| 33 |
+
gr.Textbox(label="Topic", placeholder="algebra, calculus, geometry..."),
|
| 34 |
+
gr.Slider(1, 10, value=3, step=1, label="Number of problems")
|
| 35 |
],
|
| 36 |
+
outputs=gr.Textbox(label="Generated Problems", lines=20),
|
| 37 |
+
title="Math Problem Generator",
|
| 38 |
description="Generate math problems using AI"
|
| 39 |
)
|
| 40 |
|
| 41 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|