Spaces:
Sleeping

andevs commited on
Commit
6ec833c
Β·
verified Β·
1 Parent(s): 9ab36c2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -48
README.md CHANGED
@@ -1,60 +1,38 @@
1
- # StudyLoop AI Backend
2
-
3
- Intelligent study question generator powered by Hugging Face.
4
-
5
- ## πŸš€ Features
6
-
7
- - **Smart Question Generation**: Multiple question types (MCQ, short answer, etc.)
8
- - **Concept Extraction**: Automatically identifies key concepts
9
- - **Intelligent Caching**: Reduces API calls and improves performance
10
- - **Rate Limiting**: Prevents abuse
11
- - **Multiple Fallbacks**: Always returns questions, even if AI fails
12
- - **Streaming Support**: Real-time question generation
13
-
14
- ## πŸ“‘ API Endpoints
15
 
16
- ### Main Endpoints
17
- - `POST /api/generate` - Generate questions from text
18
- - `POST /api/generate-more` - Generate follow-up questions
19
- - `POST /api/validate` - Validate content before processing
20
- - `POST /api/analyze-concepts` - Extract key concepts
21
-
22
- ### Health & Info
23
- - `GET /` - Service info
24
- - `GET /health` - Health check
25
- - `GET /models` - Available AI models
26
- - `GET /admin/stats` - Admin statistics
27
-
28
- ## πŸ”§ Configuration
29
-
30
- ### Environment Variables
31
- - `HF_TOKEN`: Hugging Face API token (optional)
32
- - `ENVIRONMENT`: `development` or `production`
33
- - `PORT`: Server port (default: 7860)
34
 
35
- ### AI Models
36
- Primary models used (all free tier):
37
- - `microsoft/phi-2`: Fast and capable
38
- - `google/flan-t5-small`: Reliable fallback
39
- - `facebook/bart-large-cnn`: For explanations
40
 
41
- ## πŸš€ Deployment on Hugging Face Spaces
42
 
43
- 1. **Create a new Space** with Docker SDK
44
- 2. **Upload all files** from this directory
45
- 3. **Add your Hugging Face token** as a secret (optional but recommended)
46
- 4. **Wait for build** (2-3 minutes)
 
47
 
48
- Your API will be available at: `https://yourusername-studyloop.hf.space`
49
 
50
- ## πŸ§ͺ Testing
51
 
 
52
  ```bash
53
- # Test health endpoint
54
- curl https://yourusername-studyloop.hf.space/health
55
 
56
  # Generate questions
57
- curl -X POST https://yourusername-studyloop.hf.space/api/generate \
58
- -F "text=Your study material here..." \
59
  -F "session_id=test123" \
60
  -F "options={\"num_questions\": 5}"
 
1
+ ---
2
+ title: StudyLoop AI
3
+ emoji: πŸ“š
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: docker
7
+ sdk_version: "3.0"
8
+ python_version: "3.11"
9
+ app_file: app.py
10
+ pinned: false
11
+ ---
 
 
 
12
 
13
+ # StudyLoop AI Backend
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ πŸš€ **Intelligent study question generator powered by Hugging Face AI**
 
 
 
 
16
 
17
+ ## πŸ“‹ Features
18
 
19
+ - **πŸ€– AI-Powered Questions**: Generate multiple choice, short answer, true/false questions
20
+ - **🎯 Smart Content Analysis**: Extracts key concepts and learning objectives
21
+ - **⚑ Fast & Reliable**: Optimized for Hugging Face Spaces with intelligent fallbacks
22
+ - **πŸ“Š Smart Caching**: Reduces API calls and improves response times
23
+ - **πŸ›‘οΈ Safe & Secure**: Content validation and rate limiting
24
 
25
+ ## πŸš€ Quick Start
26
 
27
+ Your API is live at: **`https://andevs-studyloop.hf.space`**
28
 
29
+ ### Test the API:
30
  ```bash
31
+ # Health check
32
+ curl https://andevs-studyloop.hf.space/health
33
 
34
  # Generate questions
35
+ curl -X POST https://andevs-studyloop.hf.space/api/generate \
36
+ -F "text=Photosynthesis is the process plants use to convert sunlight into chemical energy." \
37
  -F "session_id=test123" \
38
  -F "options={\"num_questions\": 5}"