Commit graph

986 commits

Author SHA1 Message Date
Roland Tannous
4cef5fb030 fix: harden template mapping for complex column types and curly braces
- Handle dict columns (e.g. squad answers) by extracting text instead
  of raw repr()
- Handle list columns by joining or extracting single value
- Catch ValueError in .format() calls (stray { } in column data)
- Add missing json import to dataset_utils.py
2026-03-10 15:43:35 +00:00
Roland Tannous
c5ffe1e724 feat: Dataset Conversion Advisor — multi-pass LLM for non-conversational datasets
Non-conversational HF datasets (e.g. stanfordnlp/snli) were naively mapped
column→role, producing poor training results. The AI Assist button now runs
a 3-pass advisor using Qwen 7B that:
1. Fetches the HF dataset card/README to understand the dataset purpose
2. Classifies the dataset type and determines if conversion is needed
3. Generates a system prompt, user/assistant templates with {column}
   placeholders, and label mappings (e.g. 0→entailment)
4. Validates the conversion quality (score ≥7/10 required)

Architecture: advisor metadata flows as __-prefixed keys in
custom_format_mapping (e.g. __system_prompt, __user_template,
__assistant_template, __label_mapping). The existing _apply_user_mapping()
detects these keys and routes to template-based conversation construction.
No __ keys = existing simple mode (backwards compatible).

Backend: upgraded llm_assist.py (7B default, multi-pass advisor,
HF card fetching), extended API models, added _apply_template_mapping()
to dataset_utils.py.

Frontend: extended store with advisor state fields, wired AI Assist
to store templates/system prompt, inject __ metadata in training request,
show advisor notification banner in mapping card.
2026-03-10 15:39:56 +00:00
Roland Tannous
12b53ca260 fix: download all GGUF shards for split models (e.g. 7B Q8_0)
LlamaCppBackend.load_model() and precache_helper_gguf() only downloaded
the first matching GGUF file. For split models (e.g. 7B Q8_0 with 3
shards), llama-server needs all shards present. Now collects and
downloads all matching files.
2026-03-10 15:08:20 +00:00
Roland Tannous
20264e973e debug: decode first sample after train_on_completions masking 2026-03-10 14:08:14 +00:00
Roland Tannous
9fd08a3f25 debug: fix dataset access - result is a dict, use dataset['dataset'] 2026-03-10 13:19:31 +00:00
Roland Tannous
a5d9f611e6 debug: improve sample preview with type info and traceback 2026-03-10 12:56:24 +00:00
Roland Tannous
10ba97c34c debug: switch to print() for subprocess visibility 2026-03-10 12:49:01 +00:00
Roland Tannous
19cbf575ac debug: add temporary log statements for dataset preview and VLM instruction 2026-03-10 12:35:55 +00:00
Roland Tannous
5d97f42af4 feat: add AI Assist button for user-triggered column classification
Move LLM-assisted column mapping from silent /check-format automation
to an explicit "AI Assist" button in the dataset mapping dialog. This
makes the feature transparent and user-controlled.

- Remove llm_classify_columns() from check_dataset_format() (heuristic-only)
- Remove auto-save suggested_mapping from use-training-actions.ts
- Add POST /api/datasets/ai-assist-mapping endpoint (receives preview
  samples from frontend, no dataset re-loading needed)
- Add AiAssistMappingRequest/Response models
- Add aiAssistMapping() frontend API function
- Add Sparkles AI Assist button to DatasetMappingCard with loading state
- Wire up handleAiAssist handler in dataset-preview-dialog.tsx
2026-03-10 11:09:01 +00:00
Roland Tannous
4523f056c2 fix: LLM-assisted mapping flows from /check-format to training
- Frontend auto-saves suggested_mapping into datasetManualMapping when
  check-format returns requires_manual_mapping=false, so the mapping
  flows to training via custom_format_mapping (no redundant AI calls)
- Backend returns meaningful warning when column detection fails
  (LLM-generated or static fallback) for both text and VLM datasets
- /check-format endpoint merges check_dataset_format warnings with
  existing URL-based image detection warnings
2026-03-10 09:58:58 +00:00
Roland Tannous
afad614bfa feat: add LLM-assisted dataset detection using ephemeral GGUF helper
Uses Qwen2.5-3B-Instruct Q8_0 via LlamaCppBackend to complement
heuristic-based dataset detection when heuristics are uncertain.

- New llm_assist.py: VLM instruction generation, column classification,
  and user-friendly warning generation for dataset issues
- Pre-cache helper GGUF on FastAPI startup (background thread)
- Reorder training pipeline: dataset processing runs BEFORE model load
  to avoid VRAM contention (detect → dataset → model → train)
- Add pre_detect_and_load_tokenizer() for lightweight detection
- LLM warnings on VLM conversion failures (broken URLs, missing images)
- LLM column classification fallback when heuristics return unknown
- Graceful degradation: all paths unchanged when helper unavailable
2026-03-10 09:20:45 +00:00
Roland Tannous
22eb0eea29 Revert "Merge pull request #347 from unslothai/feature/studio-storage-roots"
This reverts commit e9c7b97d23, reversing
changes made to b75cc9b959.
2026-03-10 01:52:47 +00:00
Roland Tannous
e9c7b97d23 Merge pull request #347 from unslothai/feature/studio-storage-roots
update studio storage roots
2026-03-10 05:49:42 +04:00
Roland Tannous
b75cc9b959 Merge pull request #350 from unslothai/fix/vision-datasets-fix
Fix VLM dataset detection and conversion
2026-03-10 05:48:27 +04:00
Roland Tannous
0a81ee38e6 fix: fall back to auto-detection when user VLM mapping fails
Instead of erroring out when custom_format_mapping fails conversion,
clear it and let auto-detection try. Handles stale cached mappings.
2026-03-10 01:42:25 +00:00
Roland Tannous
2ce77f8879 fix: probe image column candidates when multiple exist
When multiple image columns are found, probes them (HEAD for URLs,
os.path.exists for paths) and picks the first that works.
Skips probing when top candidate is PIL/dict (score >= 75).
2026-03-10 01:38:33 +00:00
Roland Tannous
b515ce6a7d fix: prefer URL image columns over bare filenames, add value-based fallback
find_image_column now scores candidates by resolvability (PIL > dict > URL > path)
and has a Pass 2 value-based fallback for columns not matching image keywords.
Fixes phiyodr/coco2017 picking file_name (unresolvable) over coco_url (resolvable).
2026-03-10 01:36:19 +00:00
Roland Tannous
698c9564ef fix: detect list-of-strings text columns and pick random element for VLM conversion
Handles datasets like phiyodr/coco2017 where captions is a list of strings.
2026-03-10 01:32:19 +00:00
Roland Tannous
095a051ee0 feat: add ShareGPT+image VLM format support and improve image column detection
- Detect and convert ShareGPT/ChatML conversations with <image> placeholders
- Add file_name/filename as image column keywords
- Detect image paths and URLs by value (string ending in .jpg/.png/etc)
2026-03-10 01:27:36 +00:00
Roland Tannous
87269a5c85 fix: use word-boundary matching for image/audio column detection
Substring matching caused false positives like 'pic' in 'topic',
leading to non-deterministic image column selection.
2026-03-10 00:38:02 +00:00
Manan17
8ce792b341 shifting setup & co inside studio 2026-03-09 23:48:31 +00:00
Shine1i
f2b2b33769 feat(studio): add auth-specific paths and integrate auth database location 2026-03-09 23:48:31 +00:00
Shine1i
c2871fcff8 fix(studio): update temporary directory path to use system temp dir 2026-03-09 23:48:31 +00:00
Shine1i
b08b606b21 feat(studio): studio storage roots path utilities 2026-03-09 23:48:31 +00:00
Roland Tannous
d56c1c8dde fix: resolve bare-filename images via HF repo lookup
Datasets like VQAonline store image filenames (e.g. "img.png") without
the directory prefix. Build a basename→repo_path lookup using
list_repo_files, then resolve each file via hf_hub_download.
2026-03-09 23:37:00 +00:00
Roland Tannous
bd4de6cf1f fix: prefer tabular files over archives in Tier 1 dataset preview
Tier 1 check-format was picking images.zip over testmini.parquet,
causing wrong columns (image/label) and broken VLM mapping.
Also log first VLM conversion failure instead of swallowing silently.
2026-03-09 22:00:20 +00:00
Roland Tannous
4ceaeb3649 Merge pull request #349 from unslothai/license/agpl3-studio
Add AGPL-3.0 SPDX headers to all source files
2026-03-10 00:30:29 +04:00
Roland Tannous
a0f03d3080 Add AGPL-3.0 SPDX headers to all source files 2026-03-09 20:17:45 +00:00
Roland Tannous
2916a2dfcb Merge pull request #348 from unslothai/license/agpl3-studio
Main license file for studio codebase
2026-03-09 23:38:08 +04:00
Roland Tannous
11aa870d96 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
Wasim Yousef Said
36b297c79b Merge pull request #344 from unslothai/style/ui-feedback
Refine UI spacing, icons, and border radius per feedback
2026-03-09 19:24:12 +01:00
Wasim Yousef Said
5a0eb7e646 Merge pull request #345 from unslothai/feature/fixes-client
feat(studio): fix chat code block actions and some training view changes
2026-03-09 19:22:19 +01:00
Shine1i
d31420acc3 feat(recipe-studio): add support for managing tools by provider in tool profiles 2026-03-09 19:19:14 +01:00
Shine1i
992e07495f Merge remote-tracking branch 'origin/nightly' into feature/fixes-client 2026-03-09 19:07:42 +01:00
Roland Tannous
65d3539bac Merge pull request #342 from unslothai/local-dataset
dataset upload
2026-03-09 21:22:23 +04:00
Roland Tannous
3745e06776 store uploaded datasets under assets/datasets/uploads instead of ~/.cache 2026-03-09 17:06:36 +00:00
Roland Tannous
0d26de7d50 Revert "narrow stale selection guard to only skip clearing for uploaded files"
This reverts commit 7825558f1b.
2026-03-09 16:51:30 +00:00
Roland Tannous
b8dd4e2615 Merge pull request #346 from unslothai/fix/eval-loss-worker-filtering
fix: eval loss broken after subprocess isolation refactor
2026-03-09 20:43:19 +04:00
Roland Tannous
a8992279b6 fix: split dataset 80/20 when eval split matches train split 2026-03-09 16:36:44 +00:00
Shine1i
b9f2820cd6 chore(data-recipe): bump data-designer to 0.5.2 and pin duckdb<1.5 2026-03-09 17:27:02 +01:00
Roland Tannous
73c4027d70 fix: disable Start Training when eval_steps set without eval split 2026-03-09 16:20:00 +00:00
Shine1i
7c153f6a53 feat(recipe-studio): remove MCP tools-related dialogs and refactor tool profile management logic 2026-03-09 17:04:15 +01:00
Roland Tannous
a7d78d16be fix: restore eval_enabled early signal for subprocess training 2026-03-09 15:35:49 +00:00
Shine1i
24cb20c076 feat(recipe-studio): improve UI responsiveness and fix JSON preview handling 2026-03-09 16:04:46 +01:00
Roland Tannous
d85176ba1a fix: allow eval-only progress events through worker callback filter 2026-03-09 14:39:49 +00:00
Shine1i
984a762063 feat(studio): centralize chart styling and formatting 2026-03-09 15:34:15 +01:00
Roland Tannous
7825558f1b narrow stale selection guard to only skip clearing for uploaded files 2026-03-09 14:01:02 +00:00
Roland Tannous
8d81c991f8 switch dataset upload from base64 JSON to multipart/form-data with streamed writes 2026-03-09 13:55:45 +00:00
Roland Tannous
07ba02d610 include all candidate files when scanning a directory, not just the first 2026-03-09 13:52:45 +00:00
Shine1i
87f982aa3f feat(studio): rework chart settings with a new preferences store and revamped settings UI 2026-03-09 14:47:20 +01:00