A newer version of the Gradio SDK is available: 6.20.0
title: slidegent
emoji: π
colorFrom: blue
colorTo: gray
sdk: gradio
sdk_version: 5.34.2
app_file: app.py
python_version: '3.11'
pinned: false
Slidegent β PowerPoint Template Customizer
Build Small Hackathon 2026 submission by @jomasego
Upload any .pptx template, describe what you need, and get a fully styled, multi-slide presentation back in seconds β powered by google/gemma-4-12b-it on ZeroGPU.
Generate styled presentations from a user-provided .pptx design template, guided by LLM-produced structured slide JSON.
What This App Does
- Accepts a template upload (
.pptx) and a freeform topic prompt. - Parses template style hints (font/color/layout and shape geometry) from slide
0or1. - Calls a Gemma-style chat model with a strict JSON schema requirement.
- Defensively parses/validates malformed model outputs.
- Compiles a downloadable
.pptxusingpython-pptxand template-derived style signals.
Required Dependencies
The required runtime dependencies are in requirements.txt:
gradiotransformerstorchacceleratepython-pptxspaces
Space runtime is pinned in runtime.txt to Python 3.11 for better binary wheel compatibility (notably llama-cpp-python).
Optional local-backend/deployment tooling used for deeper validation:
llama-cpp-pythonopenai(for vLLM OpenAI-compatible server)huggingface_hub
Run Locally
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.py
Backend Options
Set MODEL_BACKEND environment variable:
llama.cpp(default): uses GGUF and auto-resolves fromunsloth/gemma-4-12b-it-GGUFwhenLLAMA_CPP_MODEL_PATHis not set.transformers: optional fallback that usesunsloth/gemma-4-12b-itthrough Hugging Face Transformers.vllm: uses OpenAI-compatible endpoint (VLLM_BASE_URL,VLLM_MODEL_NAME).
GGUF-related environment variables:
GGUF_MODEL_REPO(default:unsloth/gemma-4-12b-it-GGUF)GGUF_CACHE_DIR(default:models)LLAMA_CPP_MODEL_PATH(optional explicit path override)ENABLE_STARTUP_WARMUP(autoby default; on Spaces this pre-caches model files at startup in a background thread)
Startup warmup behavior:
- In Space environments (
SPACE_ID/HF_SPACE_IDpresent), warmup auto-starts by default. - Set
ENABLE_STARTUP_WARMUP=falseto disable. - Set
ENABLE_STARTUP_WARMUP=trueto force warmup in local environments.
Quick Local Backend Smoke Test (llama.cpp)
pip install llama-cpp-python huggingface_hub openai
python scripts/local_backend_smoke.py
If you want to force a specific local model path:
MODEL_BACKEND=llama.cpp \
LLAMA_CPP_MODEL_PATH=/absolute/path/to/model.gguf \
python scripts/local_backend_smoke.py
Or rely on auto-download from Hugging Face:
MODEL_BACKEND=llama.cpp \
GGUF_MODEL_REPO=unsloth/gemma-4-12b-it-GGUF \
python scripts/local_backend_smoke.py
Tests
pytest -q
Hugging Face ZeroGPU Space Deployment
- Create a new Space under your account (
SDK: Gradio, hardware can stay CPU/ZeroGPU-compatible). - Push this folder to that Space repository.
- Ensure
app.pyis at repo root and dependencies are inrequirements.txt. - Add any runtime environment variables in Space settings (
MODEL_BACKEND, etc).
Example creation/push flow with token:
export HF_TOKEN=your_token_here
python - <<'PY'
from huggingface_hub import HfApi
api = HfApi(token="${HF_TOKEN}")
api.create_repo(repo_id="jomasego/powerpoint-template-customizer-zerogpu", repo_type="space", exist_ok=True, space_sdk="gradio")
print("Space ready")
PY
Then push with git:
git init
git add .
git commit -m "Initial ZeroGPU app"
git remote add origin https://huggingface.co/spaces/jomasego/powerpoint-template-customizer-zerogpu
git push -u origin main
Links
- π€ Live Space
- πΉ Demo video
- πΌ LinkedIn post
- ποΈ Build Small Hackathon
Build Stamp
2026-06-15T22:15:24.820262+00:00