Commit graph

827 commits

Author SHA1 Message Date
Roland Tannous
cfad8ec36d fix: reset checkpoint metadata on failed export checkpoint reload 2026-03-07 23:29:34 +00:00
Roland Tannous
58467aac3d fix: validate pip exit codes for .venv_t5 installs in setup.ps1 2026-03-07 23:25:13 +00:00
Roland Tannous
b8577565cd add .venv_t5/ to .gitignore 2026-03-07 23:21:48 +00:00
Roland Tannous
9543fa0d1c fix: scope dataloader_num_workers=0 to Windows + transformers 5.x only 2026-03-07 17:55:59 +00:00
Roland Tannous
dcebfe718a fix: prevent training hang on Windows by adding triton-windows support 2026-03-07 17:53:36 +00:00
Roland Tannous
c882a3d2f7 fix: propagate PYTHONPATH to child subprocesses, revert tokenizer patching 2026-03-07 11:28:24 +00:00
Roland Tannous
ac608be800 fix: patch TokenizersBackend in export output after save_pretrained 2026-03-07 10:57:51 +00:00
Roland Tannous
42bd976a2f fix: patch TokenizersBackend by model name - Qwen3.5→Qwen2Tokenizer, GLM→PreTrainedTokenizer 2026-03-07 10:29:59 +00:00
Roland Tannous
44e9b838ae fix: patch Qwen3.5 broken tokenizer_class TokenizersBackend across all backends 2026-03-07 09:43:25 +00:00
Roland Tannous
d5138c529f fix: bump transformers to 5.2.0 and pin huggingface_hub in setup.ps1 2026-03-07 09:12:12 +00:00
Roland Tannous
f101befca7 fix: bump transformers 5.x pin from 5.1.0 to 5.2.0 for Qwen3.5 support 2026-03-07 09:10:09 +00:00
Roland Tannous
2c4c598832 fix: fail fast if runtime pip install of transformers 5.x fails 2026-03-07 08:40:25 +00:00
Roland Tannous
082a6f876e fix: join prior pump thread before starting new training job 2026-03-07 08:37:03 +00:00
Roland Tannous
48456070a7 fix: correct project root depth in model_config.py vision check 2026-03-07 08:15:29 +00:00
Roland Tannous
717d5d621d fix: drain stale events from resp_queue after generation cancel 2026-03-07 08:12:16 +00:00
Roland Tannous
ad6739be7a fix: wait for training shutdown before export load, clear stop flag on reset
1. Export route: stop_training() only signals the subprocess — wait up to
   30s for it to actually exit before loading the export checkpoint, avoiding
   a GPU memory race.

2. Training reset: clear _should_stop so /api/train/status returns phase=idle
   instead of staying stuck on phase=stopped after a user-triggered stop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:16:10 +00:00
Roland Tannous
08032e35a7 fix: add /v1 proxy entry to vite dev server config
Without this, /v1/chat/completions requests in local dev are served by
Vite instead of being proxied to the FastAPI backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:09:28 +00:00
Roland Tannous
2558125a14 fix: serialize generation with _gen_lock to prevent concurrent queue readers
Two overlapping /chat/completions requests could both read from the shared
resp_queue, consuming and dropping each other's token events. Replace the
request_id filtering (which silently dropped non-matching messages) with a
threading.Lock that serializes generation — correct for single-GPU inference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:06:51 +00:00
Roland Tannous
cac409198f fix: log final GGUF file locations after relocation 2026-03-06 18:04:27 +00:00
Roland Tannous
e72293a033 fix: increase export timeout to 1 hour for large model GGUF conversion 2026-03-06 17:59:42 +00:00
Roland Tannous
2cfcaa8b61 feat: broaden Qwen3.5 matching to cover entire family 2026-03-06 16:48:28 +00:00
Roland Tannous
c31e8a6ed7 feat: add Qwen3.5-35B-A3B and Qwen3-Next to transformers 5.x model list 2026-03-06 10:54:48 +00:00
Roland Tannous
527db4ffff feat: add OpenAI-compatible /v1/chat/completions endpoint 2026-03-06 07:48:09 +00:00
Roland Tannous
7e59440029 fix: pin huggingface_hub==1.3.0 in .venv_t5 (satisfies transformers 5.x) 2026-03-06 06:19:28 +00:00
Roland Tannous
c82e3d86bb fix: unload competing subprocesses before load across all routes 2026-03-06 06:05:31 +00:00
Roland Tannous
661ac4be96 feat: subprocess-based export, pin huggingface_hub==0.36.0 2026-03-06 06:03:09 +00:00
Roland Tannous
f15970c02a fix: use subprocess with transformers 5.x for vision detection
Models like GLM-4.7-Flash have architectures (glm4_moe_lite) that
AutoConfig in the main process (transformers 4.57.x) can't recognize.
Instead of a raw config.json workaround, run the AutoConfig check in
a subprocess with .venv_t5/ activated — same pattern as training and
inference workers. This is more robust and consistent.
2026-03-06 04:51:23 +00:00
Roland Tannous
67121ce427 fix: handle unrecognized model architectures in vision detection
AutoConfig.from_pretrained() fails for models needing transformers 5.x
(e.g. glm4_moe_lite) when running with 4.57.x. Add a raw config.json
fallback that bypasses AutoConfig's architecture registry — fetches
config.json directly from local path or HuggingFace Hub and checks
for vision indicators without needing the architecture to be registered.
2026-03-06 04:46:51 +00:00
Roland Tannous
d55e9abcca refactor: consolidate version switching to .venv_t5, remove .venv_overlay
All version switching now uses .venv_t5/ (pre-installed by setup.sh).
The old .venv_overlay/ with runtime pip installs is removed.
ensure_transformers_version() (used only by export) now does a
lightweight sys.path swap instead of pip installing at runtime.
2026-03-06 04:37:06 +00:00
Roland Tannous
ce9bfd7476 fix: unload inference model before training to free GPU memory
When starting training, shut down the inference subprocess first
so the training subprocess has full GPU memory available.
2026-03-05 22:28:11 +00:00
Roland Tannous
e866d16787 fix: indentation error in orchestrator load_model 2026-03-05 19:43:30 +00:00
Roland Tannous
b598cf0c14 fix: always spawn fresh subprocess per model load
Reusing a subprocess after unsloth patches torch internals causes
inspect.getsource() failures when loading a different model type.
Each load now gets a clean Python interpreter.
2026-03-05 19:15:37 +00:00
Roland Tannous
5c3efd610f fix: use mp.Event for instant cross-process generation cancel
Replaces cmd_queue-based cancel polling with a shared mp.Event.
Fixes two issues:
- Loading a new model while generating no longer hangs (cancel is instant)
- Subprocess shuts down cleanly after explicit stop generation
2026-03-05 18:54:17 +00:00
Roland Tannous
b70faf8cb7 feat: subprocess-based inference for transformers version switching
Inference now runs in a persistent subprocess, solving the same
transformers version-switching problem that was fixed for training.
The subprocess stays alive between requests (model in GPU memory)
and is only restarted when switching transformers versions.

New files:
- core/inference/worker.py: subprocess entry point with command loop
- core/inference/orchestrator.py: parent-side proxy with same API

Modified:
- core/inference/__init__.py: exports orchestrator as default backend
- routes/inference.py: removed in-process ensure_transformers_version()
2026-03-05 17:47:57 +00:00
Roland Tannous
021c3aafdd fix: handle None job_id before first training run 2026-03-05 16:59:37 +00:00
Roland Tannous
36b5c6af88 fix: lazy imports in core/__init__ to prevent subprocess importing ML libs early 2026-03-05 16:56:45 +00:00
Roland Tannous
794b8fe866 fix: exclude bitsandbytes from module purge to prevent duplicate operator registration 2026-03-05 16:40:20 +00:00
Roland Tannous
06fbeb22cf fix: remove in-process version switching from models routes 2026-03-05 16:22:32 +00:00
Roland Tannous
fb29d7f999 fix: remove UnslothTrainer/get_trainer from core __init__ exports 2026-03-05 15:57:07 +00:00
Roland Tannous
f90af41c5f feat: subprocess-based training for transformers version switching 2026-03-05 15:40:32 +00:00
Roland Tannous
f57664e268 Merge nightly into feature/transformers-v5-support 2026-03-05 06:49:44 +00:00
Roland Tannous
37bff450d5 Merge pull request #314 from unslothai/fix/vlm-dataset-conversion-error-handling-local
Fix VLM training abort on URL-based dataset conversion failure
2026-03-05 10:10:58 +04:00
Roland Tannous
a1706c894f fix: check for http(s) prefix instead of bare string type for URL detection 2026-03-05 06:10:10 +00:00
Roland Tannous
2116cc5cca fix: remove benchmark scripts from git tracking
These are standalone benchmark scripts that were force-added despite being
gitignored. They have no test functions and run network calls at module
level, which breaks pytest collection in CI.
2026-03-05 06:06:47 +00:00
Roland Tannous
9907afac9f Merge pull request #313 from unslothai/feature/index-range-dataset-slicing
Fix: clear dataset slice state on file upload
2026-03-05 03:48:10 +04:00
Roland Tannous
b38df21bb5 fix: clear dataset slice state when switching to uploaded file
Prevents stale slice values from silently truncating uploaded datasets.
2026-03-04 23:42:23 +00:00
Roland Tannous
e04b9d53d6 feat: parallel URL image probe with time estimate and progress reporting
- Add 200-sample parallel probe using ThreadPoolExecutor + safe_num_proc
  to estimate download speed and failure rate before full conversion
- Abort with clear error if >=30% of probe images fail to download
- Show estimated download time in the training overlay modal
- Parallel batch conversion for URL-based datasets (vs sequential for local)
- Add warning field to /check-format response for URL-based image datasets
- Display URL warning in dataset preview dialog (amber banner)
- Thread progress_callback from trainer through format_and_template_dataset
  to convert_to_vlm_format for real-time status updates
2026-03-04 23:40:38 +00:00
Roland Tannous
db30b4105f test: add parallel download benchmark with ThreadPoolExecutor 2026-03-04 23:29:43 +00:00
Roland Tannous
1f03754c95 feat: add tqdm progress bar to VLM conversion and download benchmark test 2026-03-04 23:29:43 +00:00
Roland Tannous
63f723cc36 fix: add early probe to fail fast on datasets with too many broken image URLs 2026-03-04 23:29:43 +00:00