CoolFace
Apppublic

prd101-wd/ai_quiz_master

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

Third Grader Math Quiz – Powered by LLaMA3

This is a Streamlit-based web application that generates multiple-choice math questions for third graders using the LLaMA3 language model via Groq API. The app ensures questions are not repeated and provides instant feedback and explanations for each answer.

Features

  • —AI-generated MCQs: Each question is generated by LLaMA3 and tailored for third-grade math.
  • —No repeats: The app tracks previous questions and instructs the LLM not to repeat them.
  • —Immediate feedback: After submitting an answer, you get instant feedback and a short explanation.
  • —Score tracking: Your score and question count are displayed throughout the quiz.
  • —Simple UI: Built with Streamlit for easy interaction.

Folder Structure

.
├── app/
│   └── quiz_app.py         # Main Streamlit app
├── requirements.txt        # Python dependencies
├── Dockerfile              # Containerization instructions
├── .env                    # Environment variables (Groq API key)

Getting Started

1. Install dependencies

bash
pip install -r requirements.txt

2. Set up environment variables

Create a .env file in the root directory with your Groq API key:

GROQ_API_KEY=your_groq_api_key_here

3. Run the app

bash
streamlit run app/quiz_app.py

The app will be available at http://localhost:8501.

Docker Usage

You can run the app in a Docker container:

bash
docker build -t math-quiz-app .
docker run -p 8501:8501 --env-file .env math-quiz-app

Customization

  • —To change the quiz subject or difficulty, modify the prompt in generate_mcq() in app/quiz_app.py.
  • —To use a different LLM, update the ChatGroq initialization.

Requirements

  • —Python 3.10+
  • —Groq API key

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