This is an educational quiz question generator developed for the IBM – Mixed Reality Board and Toy Games with Granite 3 SLMs project.
The Generator utilizes:
- Quantized IBM granite-3.0-8b-instruct for question generation
- YOLO for object detection
It consists of two main components:
- A GUI desktop application for generating questions
- A FastAPI server backend for handling API requests and AI model processing
- Nvidia GPU with CUDA support (required)
- Python 3.8 or later
- pip package manager
- CUDA Toolkit properly installed
- Compatible NVIDIA drivers installed and updated
-
Clone the project
git clone https://github.com/dcloud347/EducationalQuestionGenerator.git cd EducationalQuestionGenerator
-
Install PyTorch (CUDA version)
Install the appropriate
torch
andtorchvision
versions matching your CUDA version: -
Install llama-cpp-python with CUDA or Metal support
For CUDA (Linux/Windows):
CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python
For MacOS (Metal support):
CMAKE_ARGS="-DGGML_METAL=on" pip install llama-cpp-python
-
Install dependencies
pip install -r requirements.txt
Run the desktop GUI application:
python ./main.py
Features:
- Select number of questions (1-5)
- Choose subject area
- Add specific topics (optional)
- Set target age group
- Generate and save questions to
output.json
The FastAPI server handles:
- AI Model Integration: For question generation and image recognition
- Data processing and storage
uvicorn app.main:app --reload
Access API documentation:
http://127.0.0.1:8000/docs
Deploying via Docker is also supported:
-
Build the Docker image
docker build -t educational-quiz-generator .
-
Run the Docker container
docker run --gpus all -p 8000:8000 educational-quiz-generator
Access the API at http://127.0.0.1:8000
.
The project includes a front-end UI built with teacher-ui, providing educators an intuitive interface to interact with the quiz generator.
Features:
- Intuitive Dashboard: Easily generate and manage quiz questions
- Responsive Design: Optimized for desktop and mobile
- Real-Time Interaction: Connects seamlessly with the FastAPI server for live feedback
- Customizable Settings: Choose subject area, age group, and topics with ease
For customization and deployment details, visit the teacher-ui GitHub repository.
Always test before pushing!
Run tests:
coverage run --source=app -m pytest
coverage report --show-missing
coverage html --title "${@-coverage}"
- Ensure CUDA Toolkit and compatible NVIDIA drivers are correctly installed
- Verify PyTorch version matches your CUDA version
- Confirm
llama-cpp-python
is installed withGGML_CUDA=on
(orGGML_METAL=on
for MacOS) - For MacOS, ensure Metal support is available and configured
- GPU not recognized?
- Check NVIDIA driver installation
- Check CUDA version compatibility
- Ensure environment variables like
GGML_CUDA=on
are set before installation
- Main Repository: Educational Question Generator
- Front-End UI: teacher-ui