Spaces:
Sleeping
Sleeping
Commit History
-
fix: auto-correct model class for decoder models + show Colab logs in dashboard
Viktor1. fixDecoderOnlyModelClass(): when PUSH_SCRIPT detects a decoder-only model (Qwen/GPT/Llama/Mistral/etc.) with AutoModelForSequenceClassification, automatically replaces with AutoModelForCausalLM + TaskType.CAUSAL_LM + DataCollatorForLanguageModeling(mlm=False). Removes num_labels arg. This is a server-side safety net — fences AND wrong model class are now impossible to push to Colab. 2. Training page now shows Colab output in a live terminal-style log panel. LOG events from bridge are displayed so the user can see what's happening and debug failures. ERROR events also logged with red highlighting. 3. TRAINING_FAILED now correctly sets trainingState.active = false.c2303d9 -
fix: strip fences at PUSH_SCRIPT gate + stronger AI prompt for CausalLM
ViktorRoot cause: client accumulated raw AI text (with fences) during polling; server-side stripMarkdownFences ran too late. Fix: strip fences in the PUSH_SCRIPT handler (server) so fences NEVER reach Colab regardless of source. Also: - Consolidated all 3 duplicate system+user prompts into single constants - Added CausalLM instruction to user prompt (model-specific) - Expanded isFence/stripMarkdownFences to catch python3 and startsWith - Strip fences in client on job done + sync fallback (belt & suspenders)a811ccc -
fix: strip markdown fences client-side + fix AI prompt for CausalLM models
ViktorTwo fixes: 1. Client-side fence stripping: the server's stripMarkdownFences ran after job completion but the client had already accumulated raw text with fences during polling. Now strips fences from generatedScript on the client when job finishes (and in sync fallback). 2. Architect AI prompt: added CRITICAL instruction to always use AutoModelForCausalLM for decoder-only models (Qwen, GPT, Llama, etc.) and never use AutoModelForSequenceClassification for them. Also deduplicated 3 copies of the system prompt into one constant.ca8e9a3
-
fix: auto-detect decoder-only models, always use CausalLM for Qwen/GPT/Llama
ViktorThe training script template auto-detected classification when the dataset had a 'label' column, loading Qwen3 with AutoModelForSequenceClassification instead of AutoModelForCausalLM. This caused lm_head.weight UNEXPECTED / score.weight MISSING errors and training failure. Now checks model config architectures — if any end with 'ForCausalLM', forces Language Modeling mode regardless of dataset label columns.d3cad72 -
fix: auto-push script to Colab when Start Training is clicked
ViktorThe wizard flow (Configure → Notebook → Connect → Deploy) didn't include a script push step. Now sendCommand('START_TRAINING') automatically pushes the generated script via PUSH_SCRIPT before sending START_TRAINING, with a 2s delay so Colab can receive and save the script file.e41a760 -
fix: SQLite DB path → /tmp + channel ID fallback from Colab cache
ViktorThree fixes for 'No channel ID' error on Start Training: 1. SQLite DB moved to /tmp/nexus.db — HF Spaces overlay FS may block writes to /app, silently losing all settings. 2. /api/colab/connected now persists channelId to DB when bridge HTTP-pings (belt & suspenders — cache + DB both have it). 3. /api/colab/command falls back to colabConnectionCache.channelId if DB lookup fails (auto-recovers and re-saves to DB).9d78235 -
fix: bridge uses async Supabase client — realtime requires it
ViktorThe sync supabase Client does NOT support realtime channels (raises NotImplementedError). Switched to acreate_client which creates an AsyncClient that supports .channel(), .subscribe(), and .send_broadcast() for realtime communication. Changes: - create_client → acreate_client (async factory) - Client init moved to start() (await required) - subscribe() and send_broadcast() now awaited - send_broadcast: payload= → data= (async API)533d35c
-
feat: async job + polling architecture — fixes proxy timeout wall
ViktorMajor changes (designed by Claude Sonnet 5): - POST /api/architect/jobs returns jobId immediately (202) - GET /api/architect/jobs/:id?since=N polls with incremental deltas - No long-lived connections — HF proxy can't cut anything - WiFi drops = polling resumes from last offset Fixed fake stubs: - pushToColab now sends real POST /api/colab/command (Supabase Broadcast) - sendCommand (START/STOP/PAUSE) now sends real commands - Supabase realtime: require() → dynamic import() (ESM fix) Improvements: - Provider health tracking (5min cooldown on failure) - First-token watchdog (20s — dead providers fail fast) - HF_TOKEN: Settings (sqlite) takes priority over env - tsconfig target ES2022 (was ES5 — 26 type errors fixed) - Job store with TTL 15min, 512KB cap, cleanup every 60s - Colab command whitelist validation7148885 -
fix: client-side template fallback + shorter timeouts — generation NEVER fails
Viktor- Added client-side template: even if server is completely unreachable, script is generated locally - Reduced streaming timeout: 180s → 30s per provider (total max 180s for all 6) - Reduced sync timeout: 60s → 15s per provider (total max 90s for all 6) - Added client-side timeout wrappers: 45s sync, 60s streaming - Made task description optional (auto-generates from model+dataset selection) - Flow: sync(45s) → streaming(60s) → client template (instant) — always produces a script17677bb -
fix: template fallback + 6 providers — script generation always works
Viktor AI- Added 3 more HF inference providers (fireworks-ai, sambanova, together) - Template fallback: if ALL AI providers fail, generates a working production-ready training script from parameters (no AI needed) - Reduced per-provider timeout from 120s to 60s for faster failover - Better error logging: shows which provider failed and why - Frontend shows notice when template was used vs AI-generated - Script generation now ALWAYS succeeds — no more dead endsccdc76d -
fix: sync-first architecture — eliminates network errors
PROBLEM: Browser SSE streams get killed by HF proxy, but frontend treated partial tokens as 'success' → user got truncated scripts and sync fallback was never tried. FIX: - Sync endpoint is now PRIMARY (no stream = no connection drops) - Streaming is now the FALLBACK (only if sync fails) - Sync prompt upgraded to match streaming quality (full production script) - Sync max_tokens raised to 4096 (was 2048) - Sync takes ~17s and works 100% reliablyec37b70
-
fix: restore max_tokens to 4096 + add retry back
- max_tokens 1800 was too low — scripts got cut off at ~224 lines - Restored streaming retry (attempt 2) before sync fallback - Keeps all Claude fixes: Qwen3-32B, /no_think, fence stripping, global heartbeatd5a22e0 -
fix: increase max_tokens to 1800 and strip markdown code fences
- max_tokens: 1200 → 1800 to prevent script truncation mid-line - Streaming: buffer output by lines, skip lines that are exactly \`\`\`python / \`\`\`py / \`\`\` (Qwen3-32B wraps output in MD fences) - Sync fallback: post-process full response to remove fence linesb9b1cd4 -
fix: eliminate retry-append duplication + partial-success detection
- Remove 2nd streaming retry that caused code duplication (each retry appends from scratch to existing content, creating garbled output) - Add gotTextTokens flag: if stream delivers code but drops before [DONE], frontend now treats it as success instead of failing silently - Sync fallback triggers only when streaming produced zero tokens - Remove noisy status toasts during streaming - Reduce max_tokens 2048→1200 (~25s generation instead of ~40s)b2e5bab -
fix: stream recovery when connection drops mid-generation
- Move 'if (gotTokens) streamSuccess = true' into finally block so partial generations are acknowledged even when nscale drops the TCP connection - Reduce max_tokens 3072 → 2048 (shorter gen = less time = fewer drops) - Frontend: don't clear editor between retries — partial code preserved7167172 -
fix: Qwen3-32B /no_think + skip reasoning_content tokens
- Downgrade from 235B to Qwen3-32B (sufficient for training scripts, much faster) - Add /no_think prefix to disable Qwen3 chain-of-thought reasoning phase which caused proxy timeout (reasoning_content arrives instead of content for ~30-120s before actual code, HF proxy drops idle SSE connection) - Fix delta extraction to explicitly check content length > 0 - Apply /no_think to both streaming and sync-fallback routes4a5d081 -
fix: global SSE heartbeat + upgrade model to Qwen3-235B-A22B
- Add global heartbeat interval (5s) before provider loop to prevent HF proxy from dropping idle SSE connections (root cause of 'network error') - Upgrade default model from Qwen2.5-Coder-32B to Qwen/Qwen3-235B-A22B for significantly higher code generation qualitycb1c646 -
fix: auto-retry + sync fallback for network errors in Architect
- Frontend: 2 streaming retries + non-streaming fallback endpoint - Frontend: keeps partial code on error instead of clearing - Backend: new /api/architect/generate-sync endpoint (non-streaming) - Backend: faster heartbeat (8s vs 15s) - Backend: reduced max_tokens (3072) for faster generationaf70558
-
fix: multi-provider fallback, SSE heartbeat, timeout — kills network error
Viktor- Try nscale → novita → nebius providers in order (auto-fallback) - Add 15s SSE heartbeat to prevent proxy/HF from killing idle connections - Add 3-min AbortSignal timeout per provider (no more infinite hangs) - Add X-Accel-Buffering: no header to disable proxy buffering - Reduce max_tokens 8192→4096 (scripts rarely need more, fewer timeouts) - Frontend: handle heartbeat comments, status/error messages from provider switching - Better error messages showing which provider failed and why413ee96 -
fix: embed bridge in notebook, pre-fill Supabase creds, add HTTP status ping
Viktor- Bridge script embedded directly in notebook (no wget from localhost) - Supabase URL/Key pre-filled from Space env vars - Dashboard URL passed to bridge for HTTP status ping - New /api/colab/connected and /api/colab/heartbeat endpoints - Colab status uses in-memory cache instead of broken DB queryce18c10 -
Rebrand to TRAIN YOUR AI: add Guide page, lock credentials, remove Settings from nav
Verified signature2ed4893 -
Fix: replace HfInference library with direct fetch to nscale provider (fixes fetch failed error)
Verified signaturef6dc88b -
Fix: detect env vars (Space secrets) in settings endpoint
Verified signatureea19a7e -
Fix: remove Anthropic from onboarding, require 3/3 credentials
Verified signaturea8f8dac -
Fix Dockerfile: use existing node user (uid 1000)
Verified signaturecf74fa9 -
🧠 Deploy NEXUS AI v1.0 — HF Inference powered
Verified signaturef43f811 -
initial commit
Verified signature1bd42b0