Spaces:
Runtime error
Runtime error
|
Download README.md from NathVinter/classroom: direct link, hf CLI and curl.
- Browser
- Download file 1.79 kB
-
https://huggingface.co/spaces/NathVinter/classroom/resolve/main/README.md
- Command line
-
hf download hf://spaces/NathVinter/classroom/README.md
-
curl -L -o README.md https://huggingface.co/spaces/NathVinter/classroom/resolve/main/README.md
1.79 kB
A newer version of the Gradio SDK is available: 6.32.0
metadata
title: Classroom
emoji: π
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 5.23.0
python_version: '3.12'
app_file: app.py
pinned: false
Classroom
A shared prompting classroom on Hugging Face Spaces.
- Student tab β students join with their name and the class code, then chat with the model.
- Follow the teacher tab β a read-only, live feed of the teacher's prompts and answers.
- Teacher tab (needs the teacher code) β your own prompt box (feeds the live view), every student prompt and answer, token usage per person, and a CSV export.
Data is kept in memory only. It resets when the Space restarts or goes to sleep, so export the CSV before the end of class.
Setup
- Create a new Space at https://huggingface.co/new-space and pick the Gradio SDK.
- Upload
app.py,requirements.txtand thisREADME.md(orgit pushthem to the Space repo). - Under Settings β Variables and secrets, add these:
| Name | Kind | Value |
|---|---|---|
OPENAI_API_KEY |
Secret | Your OpenAI API key |
CLASS_CODE |
Secret | The code you give students |
TEACHER_CODE |
Secret | Your own code for the Teacher tab |
OPENAI_MODEL |
Variable (optional) | Model name, default gpt-4o-mini |
TOKEN_LIMIT_PER_STUDENT |
Variable (optional) | Max tokens per student, 0 = unlimited (the default) |
- Share the Space URL (
https://huggingface.co/spaces/<you>/<space>) and the class code.
The Space must be public (or students must have access to it) for them to open the URL. All usage is billed to your OpenAI key, so consider setting
TOKEN_LIMIT_PER_STUDENT.
Run locally
pip install gradio==5.23.0 -r requirements.txt
export OPENAI_API_KEY=... CLASS_CODE=abc TEACHER_CODE=xyz
python app.py