prasai-ap commited on
Commit
ee26d29
·
verified ·
1 Parent(s): e86c2f0

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -0
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Pathshala AI
3
+ colorFrom: green
4
+ colorTo: blue
5
+ sdk: gradio
6
+ sdk_version: 4.44.0
7
+ app_file: app.py
8
+ pinned: false
9
+ ---
10
+
11
+ # Pathshala AI
12
+
13
+ Pathshala AI is a bilingual AI tutor demo for rural primary students in Nepal.
14
+
15
+ The Gradio Space accepts a student question in English, Nepali, or romanized Nepali plus optional textbook context, then returns:
16
+
17
+ - English explanation
18
+ - Nepali explanation
19
+ - 3 simple quiz questions
20
+
21
+ ## Deploy To Hugging Face Spaces
22
+
23
+ 1. Create a new Hugging Face Space.
24
+ 2. Choose `Gradio` as the SDK.
25
+ 3. Upload the files from this `hf_space/` folder into the root of the Space:
26
+ - `app.py`
27
+ - `requirements.txt`
28
+ - `README.md`
29
+ 4. Commit the files. Hugging Face will build and run the Space automatically.
30
+
31
+ You can also deploy with Git:
32
+
33
+ ```bash
34
+ git clone https://huggingface.co/spaces/YOUR_USERNAME/pathshala-ai
35
+ cp hf_space/app.py pathshala-ai/app.py
36
+ cp hf_space/requirements.txt pathshala-ai/requirements.txt
37
+ cp hf_space/README.md pathshala-ai/README.md
38
+ cd pathshala-ai
39
+ git add .
40
+ git commit -m "Deploy Pathshala AI Gradio demo"
41
+ git push
42
+ ```
43
+
44
+ ## Recommended Submission Mode
45
+
46
+ For the easiest hackathon submission, deploy the Space without `BACKEND_URL`.
47
+ It will use the built-in mock fallback, so judges can try it immediately.
48
+
49
+ For the full RAG workflow, first deploy the FastAPI backend somewhere public, then set `BACKEND_URL` in the Space settings.
50
+
51
+ ## Backend Mode
52
+
53
+ Set `BACKEND_URL` to use the FastAPI backend:
54
+
55
+ ```bash
56
+ BACKEND_URL=https://your-backend.example.com
57
+ ```
58
+
59
+ In Hugging Face Spaces, add it under:
60
+
61
+ ```text
62
+ Space settings -> Variables and secrets -> New variable
63
+ ```
64
+
65
+ The app calls `POST /ask` and displays the backend response.
66
+ If the backend returns `normalized_question`, the Space shows the interpreted question above the English explanation.
67
+
68
+ ## Mock Mode
69
+
70
+ If `BACKEND_URL` is missing or the backend is unavailable, the Space uses a simple mock fallback so the demo remains easy to try.
71
+
72
+ Example question:
73
+
74
+ ```text
75
+ soil erosion vaneko ke ho
76
+ ```
77
+
78
+ You can also try mixed romanized Nepali questions such as:
79
+
80
+ ```text
81
+ photosynthesis vaneko ke ho vana
82
+ ```