Spaces:
Paused

Laksh718 commited on
Commit
c770f00
·
1 Parent(s): 8cd76af

Fix GRPO correctness + scale config for L40S

Browse files

- Reward function now restores per-prompt env snapshot before scoring,
so each completion is judged against the state its prompt described
(not whatever env._state happened to be). Fixes silent learning-signal
decoupling that was wrecking previous runs.
- Add independent format-quality reward as second reward_func, per
hackathon guide's "use multiple independent reward signals" advice.
- Trim state_to_prompt from ~700-1000 to ~150-200 tokens (~4x faster
generation, no info loss).
- Scale defaults for L40S (was T4): Qwen2.5-1.5B, num_generations=8,
per_device_batch=2, max_steps=60, max_completion_length=192, bf16=True,
prompt_budget=200. All env-var overridable.
- Add preflight reward-variance check before training (aborts loudly
if all rewards identical = no learning signal).
- Wire real LLM into /api/compare so 'VERGIL-Trained' arm actually runs
the trained model when loaded; falls back to heuristic with clear label.
- _validate_action: only enforce target-node existence for actions that
use a target. Fixes the DO_NOTHING-with-stale-target infinite warning loop.
- parse_llm_output: coerces target to a valid pending node_id; falls back
to DO_NOTHING when LLM hallucinates a stakeholder id as target.
- Save + push model BEFORE post-training eval so a sleeping Space can't
cost us the trained adapter. Eval is now strictly optional with
SKIP_EVAL/EVAL_EPISODES/EVAL_TIMEOUT_SEC env knobs.
- Promote GPU Dockerfile to repo root (was vergil-training-space-fix/);
keep CPU Dockerfile as Dockerfile.demo for later demo Space.
- Add .dockerignore + extend .gitignore (.env, *.log) so secrets and
noise never reach the Space build.

Made-with: Cursor

11 files changed +1594 -1273
Files changed (11)
.dockerignoreAdded+19
.gitignore+4-1
Dockerfile+18-8
Dockerfile.demoAdded+13
frontend/app.js+323-271
frontend/index.html+82-61
frontend/style.css+589-617
scripts/train_grpo_colab.py+500-279
vergil-training-space-fix/DockerfileDeleted-23
vergil/api/server.py+14-2
vergil/core/env.py+32-11