| --- |
| title: TemperCheck |
| emoji: π€ |
| colorFrom: yellow |
| colorTo: red |
| sdk: gradio |
| sdk_version: "6.18.0" |
| app_file: app.py |
| pinned: false |
| short_description: How short a temper does this profile look to have? |
| tags: |
| - track:backyard |
| - achievement:offgrid |
| --- |
| |
| # π€ TemperCheck |
|
|
| Upload a social-media profile (or a screenshot of one) and TemperCheck gives a |
| playful read on **how short-tempered / difficult that person looks to deal with** |
| β a 0β100 score, a punchy verdict, and the "signals" it picked up on. |
|
|
| Built for the [Build Small Hackathon](https://huggingface.co/build-small-hackathon/) |
| using a small **Gemma 4 E4B** vision-language model (~8B params, well under the |
| 32B limit). |
|
|
| > β οΈ **It's a party game.** TemperCheck reads vibes in a picture for laughs. It is |
| > not a real personality test and makes no factual claim about any real person. |
|
|
| ## How it runs |
|
|
| On this **Space** it runs the `transformers` backend on **ZeroGPU** β the model |
| is `google/gemma-4-E4B-it`, loaded on `cuda` at startup and run inside a |
| `@spaces.GPU` function. (The Space needs an `HF_TOKEN` secret with access to the |
| gated Gemma repo.) The backend is selected automatically from the `SPACE_ID` env, |
| so there's nothing to configure. |
|
|
| Locally you can run the UI against a local Ollama instead (`uv run app.py`, opens |
| http://localhost:7140), but note Gemma 4 vision is currently unreliable in Ollama, |
| so the local path is for UI work β real verdicts come from the Space. |
|
|
| ## Configuration (env vars) |
|
|
| | Var | Default | Purpose | |
| |-----|---------|---------| |
| | `TEMPER_BACKEND` | `transformers` on a Space, else `ollama` | force a backend | |
| | `TEMPER_HF_MODEL` | `google/gemma-4-E4B-it` | transformers model id | |
| | `TEMPER_OLLAMA_MODEL` | `huihui_ai/gemma-4-abliterated:e4b-q8_0` | local Ollama model id | |
| | `OLLAMA_HOST` | `http://127.0.0.1:11434` | local Ollama server | |
| | `TEMPER_PORT` | `7140` | local Gradio port | |
|
|
| ## Tests |
|
|
| ```bash |
| uv run pytest |
| ``` |
|
|
| ## Project layout |
|
|
| - `app.py` β Gradio UI. |
| - `tempercheck/inference.py` β backend abstraction (Ollama β transformers). |
| - `tempercheck/prompt.py` β system prompt + defensive JSON parsing. |
| - `tests/test_parsing.py` β output-parsing tests (no model needed). |
|
|