Spaces:
Sleeping
Sleeping
Commit History
-
Simplify requirements: pin only gradio and pydantic range
Over-pinning all transitive deps caused pip to backtrack indefinitely when the Space builder added its own constraints (gradio[mcp,oauth], uvicorn, websockets, spaces). Pin only gradio==6.14.0 and pydantic to the range that gradio[mcp] requires (>=2.11.10,<=2.12.5); let everything else float. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>e65de94 -
Fix pydantic version conflict with gradio[mcp] extra
gradio[oauth,mcp]==6.14.0 (installed by HF Spaces) constrains pydantic to <=2.12.5. Local venv had 2.13.4 because it installed gradio without the mcp extra. Pin to 2.12.5 to satisfy both constraints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>69c82e4 -
Pin dependency versions to match working local venv
Loose version ranges caused HF Space rebuilds to resolve newer incompatible package versions. Pins Gradio server stack (gradio, fastapi, starlette, uvicorn, httpx, anyio, pydantic) to exact versions confirmed working locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b1d20e4
-
Update Goatcounter to dedicated PRISMA site; add Milestone 4c
- Change Goatcounter endpoint to prisma-rolandm.goatcounter.com (dedicated site for clean demo traffic signal, separate from personal site) - Document analytics addition as Milestone 4c in ROADMAP.md Co-authored-by: Cursor <cursoragent@cursor.com>62c221c -
Add Goatcounter analytics to page head
Co-authored-by: Cursor <cursoragent@cursor.com>ab32329
-
Restore per-IP daily session cap default to 10 (production)
Co-authored-by: Cursor <cursoragent@cursor.com>23edb94 -
Reduce per-IP daily session cap default to 2 for test phase
Co-authored-by: Cursor <cursoragent@cursor.com>2ac27ca -
Migrate to gpt-oss-120b, strict JSON schema, per-IP rate limiting
- Replace deprecated llama-3.3-70b-versatile with openai/gpt-oss-120b - Switch evaluation response_format from json_object to json_schema strict mode, eliminating the ~17% EvaluationParseError rate at the generation level; schema built dynamically from DEFAULT_ATTRIBUTES - Overhaul retry logic: one defensive transport retry (was 5x parse retry); EvaluationParseError propagates immediately - Add CapacityError for Groq 429 (daily limit hit), surfaced as a friendly toast instead of a raw error - Add per-IP daily session cap (default 10, env-var overridable) via gr.Request in app.py; in-memory counter resets daily - Document Groq project-level limits (10k RPD / 3M TPD) in inference.py - Update test suite: 42 tests, all passing; new schema shape and 429 tests added - Sync ROADMAP.md (Milestone 6), CLAUDE.md, README.md, ARCHITECTURE.md - Add PRISMA_UPDATE.md, GROQ_MIGRATION.md, SCHEMA_RETRY.md to .gitignore Co-authored-by: Cursor <cursoragent@cursor.com>47329ab
-
Increase parse-retry budget from 1 to 4 (5 total attempts)
Live testing showed a higher second-attempt failure rate than the original brief assumed (3 of 7 first-failures still surfaced a toast on the second attempt). Bumping max_attempts to 5 brings the expected user-visible error rate well into single-digit-percent territory at the cost of bounded extra latency on the failure path. Implementation pulls the count out to DEFAULT_MAX_ATTEMPTS in src/config.py so it lives with the other tunables, and parameterizes the constructor so tests can vary it without monkeypatching. Log strings now include the attempt number out of the budget so the production logs stay informative as we tune the value. InferenceError is still not retried. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>e1f5302
-
Retry once on EvaluationParseError to mask stochastic JSON drift
Llama 3.3 70B under json_object mode occasionally emits syntactically valid JSON that omits or mis-types the response field — observed roughly 17% in early-session testing on Groq (same pattern existed pre-migration on HF, so it's model behavior, not provider). With temperature 0.7 the failure is stochastic, so resampling at the same temperature usually parses cleanly — which matches the user-visible "press Send again, it works" pattern. generate() now retries once on EvaluationParseError. No backoff: the failure is sample-level, not transient API state. Logs both the first-attempt failure and the second-attempt outcome so the residual rate stays trackable. InferenceError is explicitly NOT retried; that needs proper rate-limit-aware backoff and is deferred to a separate session. The intended primary fix was strict json_schema mode, but Groq does not currently support it on llama-3.3-70b-versatile (only on openai/gpt-oss-* and meta-llama/llama-4-scout-* families). That choice and the …082c6bb
-
Remove type kwarg from gr.Chatbot (not supported in Gradio 6.x)
The bundled hygiene fix in 03732db added type="messages" based on older Gradio API guidance. In Gradio 6.x the parameter no longer exists — messages is the only supported format — so passing it raises TypeError at startup. Removing the kwarg restores boot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>6e3b1db -
Migrate inference backend from Hugging Face to Groq
HF free-tier credits were depleted, returning 402 on every call. Groq hosts the same Llama 3.3 70B Instruct model, has no depleting credit pool (only short-term per-minute rate limits), and runs noticeably faster (~250-400 vs ~30-50 tok/sec), which keeps the running-evaluation paradigm feeling responsive. The Space stays on HF Spaces; only the model call moves. PrismaInferenceClient keeps its public surface, exception types, and JSON response_format enforcement; mocks in tests/test_inference updated to the groq SDK's chat.completions.create shape. Env var is now GROQ_API_KEY (both .env and HF Space Secrets paths called out in the startup error message). README, ARCHITECTURE, and .env.example updated accordingly. Also bundled two small Gradio 6.0 hygiene fixes seen in production logs: gr.Chatbot type="messages" is now explicit, and theme/css moved from gr.Blocks to demo.launch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>03732db
-
Separate live-demo and research-paper lines in README
CommonMark collapses consecutive lines into one paragraph, so the two lines were rendering joined with a soft-break space on GitHub and HF. Add a blank line between them so each shows on its own row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ac303b1 -
Let impressions panel match chat width on mobile
The panel is pinned to 360px via flex: 0 0 360px / min-width / max-width, which on mobile leaves it wider than the chat column it stacks beneath. Override all three inside the existing max-width: 768px media query so the panel (and the bar cells / trajectory plot that flow inside it) follow the chat-column width. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>3e5167a -
Stack footer columns vertically on mobile viewports
The three-column footer relies on a 260px SVG on the left, which crowds the center and right blocks against the edge on narrow viewports. Add a max-width: 768px media query that flips the row to a centered vertical stack and shrinks the SVG to 200px. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>61f66c4 -
Code quality and polish pass for launch
- Remove dead json_schema local in src/prompt.build_system_prompt. - Move pytest into a new requirements-dev.txt so the production install on the Space stays minimal; cap huggingface_hub, dotenv, and matplotlib below their next major versions. - Strip the stale "Update [Your Name]..." comment above the footer. - Seed the initial trajectory plot with initial_state() instead of an empty dict, so render_trajectory's type contract is honored. - Switch render_trajectory from plt.subplots to the OO Figure API to avoid pyplot's global figure registry retaining handles per turn. - Reword the impressions dropdown to "Show impression after turn:". - Add an italic disclaimer under the header description for users who arrive at the live app without reading the README. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>f4b1b43 -
Finalize README, ROADMAP, and env template for launch
- README: replace four placeholders (live demo link, CMCL arXiv link, EMNLP "under review" status, real GitHub clone URL). - ROADMAP: reconcile milestones with shipped state. Milestones 3 and 4 marked done; about-panel copy, rate limiting, and usage analytics moved to Milestone 5. - .env.example: restore one-line template so README's local-setup instructions and app.py's startup error message remain valid. - .gitignore: exclude local _launch_prep.md working notes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>9fdc8c3 -
Rewrite ARCHITECTURE.md as finished v1 document
Replace all six TODO blockquotes with finalized prose. Ground the attribute-set discussion in the actual v1 set (competent, likeable, considerate, polite, formal, demanding) and frame its relationship to the CMCL/EMNLP studies honestly: v1 ships a general-purpose set, with research-specific attributes deferred to v2's extended list. Update the module-responsibilities and open-questions sections to match the current code and remaining design unknowns. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>9dad4c8
-
Add footer figure and fix SVG sizing
Drops the placeholder in favor of assets/prisma-figure-footer.svg and switches the footer SVG rule from max-width to an explicit width so the figure renders at 260px instead of collapsing to 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>15ce355
-
Surface errors as toasts instead of fake assistant messages
Failed turns no longer pollute the chat history with apology bubbles. The user's text stays in the input on failure so they can edit and retry, and chat_display now stays 1:1 with state["evaluations"]. Adds dark-themed styling for Gradio toasts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>eaecb1a -
Disable SSR on launch to fix HF Space startup hang
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>d29face -
Add HF Spaces YAML frontmatter to README
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>9dce2e8 -
Add HF Spaces .gitattributes (LFS config)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>03ec7f1 -
UI tweaks: rainbow PRISMA title, dark inputs/bubbles, selected-turn highlight, plot jitter
- Replace SVG hero with rainbow-letter PRISMA heading; left-align header - Dark styling for textareas, dropdowns, and chat bubbles - Highlight the user message for the currently selected turn (CSS + JS) - Spread overlapping markers in the trajectory plot with a small per-attribute jitter - Chatbot height 480 -> 600 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>446195c -
Drop unused EvaluationParseError import in inference module
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1d0171b -
Remove debug parse-failure print from inference client
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>12364c0 -
UI polish pass: dark theme, embedded figure, bar-cell impressions, trajectory plot
- Custom dark gr.themes.Base with violet/slate palette - Inline SVG hero image in header - Always-visible 360px-wide impressions sidebar - HTML rendering with linear-gradient bar cells (color per attribute) - matplotlib line-chart trajectory below the cells - ATTRIBUTE_COLORS palette added to config - matplotlib added to requirements.txtfbc2805 -
ROADMAP.md update
c2af76f -
Add inference module with HF API wrapper
- src/inference.py: PrismaInferenceClient wraps huggingface_hub's InferenceClient with forced JSON mode (required for Llama 3.3 70B) - Typed errors: InferenceError for API issues, EvaluationParseError bubbles up from src.evaluation for parse issues - src/config.py: MODEL_ID, DEFAULT_TEMPERATURE, DEFAULT_MAX_TOKENS - tests/test_inference.py: 10 tests with mocked InferenceClient, no real API calls7db5adc -
Force JSON mode in inference call
Add response_format={'type': 'json_object'} to chat_completion call. Without it, Llama 3.3 70B produces conversational text before attempting JSON output (0/8 parseable). With it, 8/8 parse cleanly and variance patterns match Qwen-72B smoke test.ba58dc4 -
Add evaluation module with parsing, validation, and formatting
- src/evaluation.py: parse_model_output, format_score, format_evaluation * Intensifier scale (1=not at all, 7=extremely) * Strict validation: missing fields, out-of-range scores, non-int types * Tolerates markdown code fences around JSON - src/config.py: add MIN_SCORE, MAX_SCORE, SESSION_TURN_CAP constants - tests/test_evaluation.py: 16 tests covering happy paths and error cases989cfe7
-
Refresh README with hero figure and finalize v1 attribute set
Adds prisma-figure.svg and reworks the README around it; updates CLAUDE.md and src/config.py to the v1 default attributes (competent, likeable, considerate, polite, formal, demanding); checks off M2 items in ROADMAP and notes the v2 attribute-customization plan. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>650d835 -
Add system prompt and test harness (M2)
- src/prompt.py: dual-role system prompt builder with configurable attribute list from config.py - scripts/test_prompt.py: smoke test against HF Inference API with 8 contrasting messages Validated on Qwen2.5-72B-Instruct: 8/8 JSON parse rate, healthy variance across all six attributes (range 3-5 points per attribute), patterns aligned with expected social perception (demanding+rude spikes 'demanding' and collapses 'polite'; precise/expert language elevates 'competent', etc.). Llama 3.3 70B revalidation pending Meta approval.9912839
-
Initial project scaffolding
1e436e0 -
Initial commit
Unverified signature0f1fb08