Spaces:
Sleeping
Sleeping
Commit History
-
Update README.md
Verified signature2d8bc0d
-
Update blog.md
Verified signature846ad62 -
Upload isosync_reward_curves.png
Verified signaturec8f4029 -
Update blog.md
Verified signaturee7f4688 -
Update blog.md
Verified signatureb0f78c9 -
Update blog.md
Verified signatured4aa306 -
Update blog.md
Verified signature5def43f -
add README and blog
25a347c -
add blog.md
3adae06 -
feat(openenv): add typed schemas, refresh openenv.yaml + /info
OpenEnv spec compliance — adds the typed Observation/Action/Reward Pydantic models the round 1 brief explicitly required. - schemas.py (NEW): typed envelopes - Observation: 15 fields (prompt + structured per-segment context) - Action: validated translation string - Reward: decomposed into combined + 5 components + estimated_duration - StepResponse / ResetResponse / EnvInfo / CurriculumLevel - app.py: endpoints now declare response_model=, build typed envelopes via _build_observation() and _build_reward() helpers; ResetRequest validates 1 <= level <= 4; /info returns typed EnvInfo with the live 4-level curriculum pulled from data_gen.CURRICULUM (no hardcoding) - openenv.yaml: rewritten for accuracy - 4 curriculum levels (was 3) with numeric duration_slack - Portuguese only (Hindi was removed during training to avoid catastrophic forgetting) - reward_components weights documented (timing 30 / semantic 30 / budget 20 / locale 10 / coherence 10) - deployment …e7925a9 -
feat(isosync): smoother 4-level curriculum + length-explicit prompt
Two structural changes targeting the 0.6 reward ceiling we keep hitting: 1. CURRICULUM: 3 levels -> 4 levels (data_gen.py + train.py) Old: L1 0.5s -> L2 0.2s -> L3 0.05s New: L1 0.5s -> L2 0.3s -> L3 0.15s -> L4 0.05s The L2->L3 jump from 0.2s to 0.05s was a 4x harder constraint with no intermediate step. The agent had no path to incremental learning at that boundary. New L3 (0.15s) bridges it; L4 keeps the hardest target. Episode allocation: L1 0-99 (100 ep, warm-up) L2 100-199 (100 ep, easy compression) L3 200-399 (200 ep, real compression) L4 400-699 (300 ep, maximum compression) 2. PROMPT: length limit moved from buried Rules section to top header The old prompt mentioned 'Max syllables: N' as one line in a list of metadata. The model ignored it (timing reward stuck at 0.000 most of training). New prompt: - Title is 'DUBBING TRANSLATION - STRICT LENGTH LIMIT' - Hard limit shown twice with *** banners before the sour…73c81a4 -
chore(isosync): silence noisy transformers/unsloth warnings
- Set TRANSFORMERS_VERBOSITY=error and ignore FutureWarning/UserWarning before any imports — kills the deprecation spam from attn_mask_utils - Clear model.generation_config.max_length so generate() stops printing the 'Both max_new_tokens and max_length' warning on every call - Call transformers.logging.set_verbosity_error() after model loads Logs are now readable instead of buried under repeated warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ad27992 -
feat(isosync): improve training - longer run, smooth budget reward
Changes targeting the issues seen in the previous training graphs: - TOTAL_EPISODES 500 -> 700: previous run early-stopped at ep 325 just as L3 was starting; give it more time to converge on tight constraints - Curriculum rebalanced: L1 100ep, L2 150ep, L3 450ep (was 200/100/200). L3 is the hardest level (0.05s slack) and needs the most training time - PATIENCE 100 -> 200: reward variance is high, premature stopping was cutting off the best learning window - CHECKPOINT_EVERY 100 -> 50: more frequent checkpoints in case of crash - Budget reward: replaced step thresholds with smooth exponential decay (exp(-deficit/2)). Previous version plateaued at 0.2 from 1-3s deficit giving no gradient signal to push tighter. Smooth curve gives gradient at every level: 1s -> 0.61, 2s -> 0.37, 3s -> 0.22 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a23b50a
-
fix: add HuggingFace Spaces YAML metadata to README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0e954d5 -
chore: remove binary plots from tracking, add .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>d67ec94 -
Merge branch 'main' of https://huggingface.co/spaces/varun1235/dubguard-training
# Conflicts: # README.md2997c70 -
feat(dubguard): use generated_dataset.json for training
- data_gen.py: fix PASS segment fix_duration=0.0 (was est_dur, caused false validation failures); replace emoji in diagnostic output with ASCII for Windows cp1252 compatibility - data/loader.py: add load_from_generated() to convert data_gen schema to {observation, ground_truth}; load_all() now prefers generated_dataset.json when present (962 episodes, syllable-based durations, locale checks, deduplication) - data/generated_dataset.json: 962 episodes (es=30%, hi=33%, pt=36%), 0 validation failures, avg locale score 0.095 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>5ec1d15 -
DubGuard: syllable TTS, locale detection, deduplication, diagnostic __main__
data_gen.py: - estimate_tts_duration: WPM → syllable-based (4.5/5.2/5.0/4.0 syl/s per language) - LOCALE_WORDS + check_locale_words: BR/IN/AR approved/penalized word lists - Deduplication trackers: _used_clean_entries set prevents repeat sentences - generate_base_segment: duration range 1.5-4.0s, max_allow +0.15s - add_clean_segment: deduplication + 3-attempt retry loop + locale_check field - add_timing/mistranslation/tone_mismatch/cultural: locale_check on each segment - add_cultural_mismatch: removes dummy placeholder text, uses entry original_en - generate_episode: equal lang distribution (34/33/33%), Hindi Devanagari check - validate_episode: dummy text check, per-error fix_duration check, locale_check warn - __main__: full diagnostic report with language dist, locale score, budget checks rewards/correction.py: WPM → syllable-based timing estimate plot_results.py: new training visualiser for DubGuard CSV schema (detection, severity, correction, cultural, false_positive, combined)…d4c4834 -
Fix budget/locale rewards, remove Hindi regression, add LR scheduler + early stopping
- budget_reward: graduated thresholds (1/3/6/10s) — agent had zero signal at 8-15s deficits - locale_reward: approved/penalized wordlists with 0.05 floor — was always 0.0 - Level 3 curriculum: harder Portuguese (10 seg, 0.05s slack) replaces Hindi — stops catastrophic forgetting - TOTAL_EPISODES: 1000 → 500 with updated thresholds (L1:0-150, L2:150-300, L3:300-500) - LR scheduler: StepLR decay 10%/100 episodes to prevent late-training instability - Early stopping: saves best_model checkpoint, stops at patience=100 - plot_results.py: rewritten with smoothed dual-panel layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ec48090 -
Fix budget/locale rewards, remove Hindi regression, add LR scheduler + early stopping
- budget_reward: graduated thresholds (1/3/6/10s) — agent had zero signal at 8-15s deficits - locale_reward: approved/penalized wordlists with 0.05 floor — was always 0.0 - Level 3 curriculum: harder Portuguese (10 seg, 0.05s slack) replaces Hindi — stops catastrophic forgetting - TOTAL_EPISODES: 1000 → 500 with updated thresholds (L1:0-150, L2:150-300, L3:300-500) - LR scheduler: StepLR decay 10%/100 episodes to prevent late-training instability - Early stopping: saves best_model checkpoint, stops at patience=100 - plot_results.py: rewritten with smoothed dual-panel layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>fe48bc0 -
Use HF_TOKEN env var for Hub push
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>aa8c64a -
Use HF_TOKEN env var for Hub push
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>7f2ea11 -
Fix HF Spaces 30-min timeout: start server before training
Server now launches in background immediately so /health responds. Training runs in foreground, server stays alive after training completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>73f1bd6 -
Fix HF Spaces 30-min timeout: start server before training
Server now launches in background immediately so /health responds. Training runs in foreground, server stays alive after training completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>49f24a7 -
Add build-essential to Dockerfile for Triton C compiler
Triton JIT kernel compilation requires gcc, which was missing from the image. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>04e9132 -
Add build-essential to Dockerfile for Triton C compiler
Triton JIT kernel compilation requires gcc, which was missing from the image. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>c03e31c -
Fix torchvision version mismatch in Docker
unsloth was upgrading torch to 2.10.0 but base image had torchvision==0.16.0. Remove cuda extras tag so unsloth manages its own torch; add torchvision>=0.25.0 to ensure pip upgrades it to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>be430f1 -
Fix torchvision version mismatch in Docker
unsloth was upgrading torch to 2.10.0 but base image had torchvision==0.16.0. Remove cuda extras tag so unsloth manages its own torch; add torchvision>=0.25.0 to ensure pip upgrades it to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>25d4118 -
Fix app.py reset() signature and unsloth Docker extras tag
- Remove invalid language= kwarg from _env.reset() call in /reset endpoint - Switch unsloth extras from [colab-new] to [cu118-torch210] for Docker CUDA 11.8 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b7a2f8f -
Fix app.py reset() signature and unsloth Docker extras tag
- Remove invalid language= kwarg from _env.reset() call in /reset endpoint - Switch unsloth extras from [colab-new] to [cu118-torch210] for Docker CUDA 11.8 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>4bb1d0f -
Add budget banking, coherence reward, MCPEnvironment (innovation fixes)
Budget banking (environment.py): - Under-runs bank saved time: budget_bank += max(0, target - estimated) - Over-runs draw from bank first before incrementing deficit - Agent now has genuine strategic choice: compress early to build buffer - Budget bank balance shown in observation so model can learn to use it Coherence reward (rewards.py + environment.py): - 5th independent reward component (10% weight) - coherence_reward() scores fraction of numbers/quantities from original that appear in the translation (Arabic numerals checked across episode) - Computed from history_preview each step so model gets signal every step - Reward weights rebalanced: timing 30%, semantic 30%, budget 20%, locale 10%, coherence 10% MCPEnvironment (environment.py): - IsoSyncEnvironment now inherits MCPEnvironment instead of Environment - tools() exposes 3 named tools: translate_segment, check_budget, get_episode_summary - call_tool() routes to correct method; avoids reserved names (reset/step/state/close)…e435014 -
Add budget banking, coherence reward, MCPEnvironment (innovation fixes)
Budget banking (environment.py): - Under-runs bank saved time: budget_bank += max(0, target - estimated) - Over-runs draw from bank first before incrementing deficit - Agent now has genuine strategic choice: compress early to build buffer - Budget bank balance shown in observation so model can learn to use it Coherence reward (rewards.py + environment.py): - 5th independent reward component (10% weight) - coherence_reward() scores fraction of numbers/quantities from original that appear in the translation (Arabic numerals checked across episode) - Computed from history_preview each step so model gets signal every step - Reward weights rebalanced: timing 30%, semantic 30%, budget 20%, locale 10%, coherence 10% MCPEnvironment (environment.py): - IsoSyncEnvironment now inherits MCPEnvironment instead of Environment - tools() exposes 3 named tools: translate_segment, check_budget, get_episode_summary - call_tool() routes to correct method; avoids reserved names (reset/step/state/close)…604cac9 -
Fix all 5 critical issues in IsoSync
1. train.py: replace GRPOTrainer+static dataset with REINFORCE custom rollout loop — runs full episodes, collects (prompt, translation, reward) per step, computes policy_gradient_loss = CE * advantage, backprops per step, optimizer.step() once per episode with AdamW + grad clip 2. rewards.py: replace generic Devanagari heuristic with explicit vowel matra set + independent vowel set for accurate Hindi syllable counting; semantic_reward now takes list[str] references (multi-ref chrF) 3. data_gen.py: add second reference translation per sentence (hi_ref2, pt_ref2) for multi-ref chrF scoring; curriculum language fixed per level — L1/L2=Portuguese (Latin script, model handles well), L3=Hindi 4. environment.py: reset() no longer takes language param (curriculum decides); _format_observation includes only _prev_translation, not full history — keeps prompts within context window at L3 (10 segments) 5. data_gen.py+environment.py: reference_translations is now list…0ce8218 -
Fix all 5 critical issues in IsoSync
1. train.py: replace GRPOTrainer+static dataset with REINFORCE custom rollout loop — runs full episodes, collects (prompt, translation, reward) per step, computes policy_gradient_loss = CE * advantage, backprops per step, optimizer.step() once per episode with AdamW + grad clip 2. rewards.py: replace generic Devanagari heuristic with explicit vowel matra set + independent vowel set for accurate Hindi syllable counting; semantic_reward now takes list[str] references (multi-ref chrF) 3. data_gen.py: add second reference translation per sentence (hi_ref2, pt_ref2) for multi-ref chrF scoring; curriculum language fixed per level — L1/L2=Portuguese (Latin script, model handles well), L3=Hindi 4. environment.py: reset() no longer takes language param (curriculum decides); _format_observation includes only _prev_translation, not full history — keeps prompts within context window at L3 (10 segments) 5. data_gen.py+environment.py: reference_translations is now list…6812c05 -
Add IsoSync — isochronous translation RL environment (replaces DubGuard)
Files: - data_gen.py: 50-sentence bank (cooking/travel/lifestyle), generate_episode() - rewards.py: timing (pyphen/Unicode), semantic (chrF), budget, locale + anti-hacking - environment.py: IsoSyncEnvironment(Environment) with sequential budget tracking - train.py: GRPO curriculum L1→L2→L3, Qwen2.5-1.5B-Instruct via Unsloth - plot_results.py: reward_curves.png + budget_deficit.png from CSV log - app.py: FastAPI server /reset /step /state /info /health - client.py: HTTP client, zero server imports - openenv.yaml: OpenEnv manifest - Dockerfile + start.sh + requirements.txt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>5fcba14 -
Add IsoSync — isochronous translation RL environment (replaces DubGuard)
Files: - data_gen.py: 50-sentence bank (cooking/travel/lifestyle), generate_episode() - rewards.py: timing (pyphen/Unicode), semantic (chrF), budget, locale + anti-hacking - environment.py: IsoSyncEnvironment(Environment) with sequential budget tracking - train.py: GRPO curriculum L1→L2→L3, Qwen2.5-1.5B-Instruct via Unsloth - plot_results.py: reward_curves.png + budget_deficit.png from CSV log - app.py: FastAPI server /reset /step /state /info /health - client.py: HTTP client, zero server imports - openenv.yaml: OpenEnv manifest - Dockerfile + start.sh + requirements.txt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1b2748f -
Let unsloth manage trl/peft/transformers versions to avoid import errors
dd6f172 -
Add mergekit dependency required by trl GRPOTrainer
c9138c6 -
Train before serve: start.sh runs training then launches FastAPI
- start.sh: runs training/train.py then app.py sequentially - Dockerfile: CMD changed to bash start.sh, added chmod +x - train.py: HF_REPO_NAME set to varun1235/dubguard-qwen2.5-3b-instruct Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>60552df -
Add FastAPI server, client, OpenEnv base classes, expand README
- environment/base.py: Environment + MCPEnvironment base classes (OpenEnv spec) - environment/env.py: DubGuardEnvironment now inherits from Environment - app.py: FastAPI server exposing /reset /step /state /info /health on port 7860 - client.py: HTTP client with zero server-side imports (OpenEnv client/server separation) - Dockerfile: CMD updated to run app.py (server), EXPOSE 7860 - requirements.txt: added fastapi, uvicorn, pydantic - README.md: full rewrite with problem motivation, env design, reward table, API reference, stack, project structure Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1887f39 -
Fix tzdata interactive prompt in Docker build
2c3cdf9 -
Fix HuggingFace Space metadata
29749de -
initial setup
7779443 -
Initial commit
1c9fdfa