Commit graph

819 commits

Author SHA1 Message Date
Roland Tannous
d60cd2843f fix: patch Qwen3.5 broken tokenizer_class TokenizersBackend across all backends 2026-03-07 09:43:25 +00:00
Roland Tannous
29fa91be07 fix: bump transformers to 5.2.0 and pin huggingface_hub in setup.ps1 2026-03-07 09:12:12 +00:00
Roland Tannous
bd60562145 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
0b3397cc3a fix: fail fast if runtime pip install of transformers 5.x fails 2026-03-07 08:40:25 +00:00
Roland Tannous
f3aeceeb24 fix: join prior pump thread before starting new training job 2026-03-07 08:37:03 +00:00
Roland Tannous
f7a3092cbd fix: correct project root depth in model_config.py vision check 2026-03-07 08:15:29 +00:00
Roland Tannous
728420b290 fix: drain stale events from resp_queue after generation cancel 2026-03-07 08:12:16 +00:00
Roland Tannous
25b51fad3b 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
f45f1f74c0 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
609e3168a1 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
9470957bb9 fix: log final GGUF file locations after relocation 2026-03-06 18:04:27 +00:00
Roland Tannous
5a828ebd43 fix: increase export timeout to 1 hour for large model GGUF conversion 2026-03-06 17:59:42 +00:00
Roland Tannous
4b7ad23b3a feat: broaden Qwen3.5 matching to cover entire family 2026-03-06 16:48:28 +00:00
Roland Tannous
ed1e63c814 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
d910759121 feat: add OpenAI-compatible /v1/chat/completions endpoint 2026-03-06 07:48:09 +00:00
Roland Tannous
c3bc19494f fix: pin huggingface_hub==1.3.0 in .venv_t5 (satisfies transformers 5.x) 2026-03-06 06:19:28 +00:00
Roland Tannous
c5f4503b9e fix: unload competing subprocesses before load across all routes 2026-03-06 06:05:31 +00:00
Roland Tannous
6b32af0bdc feat: subprocess-based export, pin huggingface_hub==0.36.0 2026-03-06 06:03:09 +00:00
Roland Tannous
b5cfd0952c 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
e5c7a18f72 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
1167be2798 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
cbe2896705 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
31334cece1 fix: indentation error in orchestrator load_model 2026-03-05 19:43:30 +00:00
Roland Tannous
5bd6fac80e 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
7fc563731a 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
4eabc74f34 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
1e04149ddf fix: handle None job_id before first training run 2026-03-05 16:59:37 +00:00
Roland Tannous
842c05e75a fix: lazy imports in core/__init__ to prevent subprocess importing ML libs early 2026-03-05 16:56:45 +00:00
Roland Tannous
9696bd557a fix: exclude bitsandbytes from module purge to prevent duplicate operator registration 2026-03-05 16:40:20 +00:00
Roland Tannous
e3a1811c79 fix: remove in-process version switching from models routes 2026-03-05 16:22:32 +00:00
Roland Tannous
878f8f3924 fix: remove UnslothTrainer/get_trainer from core __init__ exports 2026-03-05 15:57:07 +00:00
Roland Tannous
f8bd4303f7 feat: subprocess-based training for transformers version switching 2026-03-05 15:40:32 +00:00
Roland Tannous
81b4928e99 Merge nightly into feature/transformers-v5-support 2026-03-05 06:49:44 +00:00
Roland Tannous
4e9c248fa8 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
c171573a8f fix: check for http(s) prefix instead of bare string type for URL detection 2026-03-05 06:10:10 +00:00
Roland Tannous
657cdaa151 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
8218cb651e 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
352fe023a5 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
9ca45826d4 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
195c1a3ce3 test: add parallel download benchmark with ThreadPoolExecutor 2026-03-04 23:29:43 +00:00
Roland Tannous
f59eaad212 feat: add tqdm progress bar to VLM conversion and download benchmark test 2026-03-04 23:29:43 +00:00
Roland Tannous
50885a7aa3 fix: add early probe to fail fast on datasets with too many broken image URLs 2026-03-04 23:29:43 +00:00
Roland Tannous
fdc23f4a43 fix: use fsspec for URL image downloads with per-sample error handling 2026-03-04 23:29:43 +00:00
Roland Tannous
8039eebcd5 test: add URL image loading comparison script 2026-03-04 23:29:43 +00:00
Roland Tannous
2b704221f7 fix: abort training pipeline on dataset conversion failure 2026-03-04 23:29:43 +00:00
Roland Tannous
929c3e9e1e fix: cast URL image columns to HF Image() type in VLM conversion 2026-03-04 23:29:43 +00:00
Roland Tannous
f55153249d Merge pull request #312 from unslothai/feature/index-range-dataset-slicing
Add index range dataset slicing to Studio training page
2026-03-05 03:25:21 +04:00
Roland Tannous
40f2dc517f fix: remove unnecessary tooltip copy from train split start 2026-03-04 23:24:09 +00:00
Roland Tannous
8199e0d2c0 refactor: move train split slice controls back to Advanced section
Place Train Split Start / End inputs inside the Advanced collapsible
with descriptive tooltips clarifying they slice the training split.
Revert the selectors component to its original eval-split-only layout.
2026-03-04 23:24:09 +00:00
Roland Tannous
5f0559926c refactor: move index range fields next to eval split in 3-col grid
Place Slice Start and Slice End inputs alongside the Eval Split
selector in a single row (grid-cols-3) so the dataset card stays
compact. Remove the duplicate controls from the Advanced section.
2026-03-04 23:24:09 +00:00