Commit graph

4,672 commits

Author SHA1 Message Date
shine1i
4dc19b63f5 feat: add DOCX attachment support using mammoth, extend attachment handling to process and extract text from DOCX files 2026-02-02 16:33:10 +01:00
shine1i
3a15b915fc feat: add PDF attachment support using unpdf, extend attachment handling and runtime to process and extract text from PDFs 2026-02-02 16:11:39 +01:00
shine1i
db92ab230b refactor: enhance chat and UI elements with animations, tooltips, and improved styling; streamline sidebar, navbar, and chat-page interactions in top bar 2026-02-02 15:25:15 +01:00
shine1i
303865438f refactor: replace depreceated useAssistantRuntime with useAui, update runtime API calls across chat features for consistency 2026-02-02 15:03:01 +01:00
shine1i
a87f14eccd refactor: remove unused components, mock data, and redundant logic across chat features; streamline settings and runtime handling for better maintainability 2026-02-02 14:52:58 +01:00
shine1i
0d30950b75 refactor: remove unused model and dataset configurations, simplify export-page logic by eliminating modelInfo dependency and redundant params display 2026-02-02 14:22:35 +01:00
shine1i
6abe1d6e35 refactor: streamline combobox logic, improve search handling, and remove unused elements across model and dataset sections 2026-02-02 14:06:34 +01:00
shine1i
99bea160b3 refactor: simplify model and dataset combobox logic, remove curated items, and streamline search handling across components 2026-02-02 13:16:08 +01:00
shine1i
af3e8c20ee refactor: format and clean up imports, hooks, and UI components for consistent structure and readability across models and datasets sections 2026-02-02 12:51:04 +01:00
shine1i
e705230499 feat: add Hugging Face search integration for datasets and models, extend infinite scroll support, and improve UI components with animations and tooltips 2026-02-02 12:45:41 +01:00
shine1i
e9857dab0f feat: replace config summary with model export feature, including export methods, quantization options, and new UI components 2026-02-02 11:08:31 +01:00
Roland Tannous
1179735255 Merge pull request #7 from unslothai/fix/restructure-repo-root
Add studio root folder and make frontend and backend as subfolders
2026-02-02 13:18:20 +04:00
Roland Tannous
8b80c71fe1 add studio root folder 2026-02-02 09:14:35 +00:00
Roland Tannous
544d6944d1 root studio folder 2026-02-02 09:13:49 +00:00
Roland Tannous
6db66ab1ff Merge pull request #6 from unslothai/fix/remove-backend-backend-directory
Fix/remove backend backend directory
2026-02-02 10:35:50 +04:00
Roland Tannous
9aec1c6cd4 remove redundant backend.backend directory 2026-02-02 06:35:00 +00:00
Datta Nimmaturi
5cf7b4e34f [fix] qwen3-guard tokenizer (#3959)
* fix for qwen3-guard tokenizer

* Better qwen3guard check

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-02-01 22:09:15 -08:00
Roland Tannous
ed8839e009 Merge pull request #5 from unslothai/feature/backend-core-restructuring
backend restructuring and housekeeping
Changes made:

- Moved all files from backend/backend/ → backend/core/ with nested subdirectories
- Created init.py for each submodule with proper exports
- Updated all imports in routes (routes/training.py, routes/models.py)
- Updated internal relative imports to use .. for parent references
- Deleted old backend/backend/ directory
- Moved shared modules (path_utils.py , model_config.py) to utils/ subfolder
2026-02-02 09:56:59 +04:00
Roland Tannous
b4861d345b Merge branch 'nightly' into feature/backend-core-restructuring 2026-02-02 09:56:19 +04:00
Roland Tannous
ce34bcd0d2 merge conflict .gitignore 2026-02-02 05:53:43 +00:00
Roland Tannous
75bd759108 fix .gitignore merge conflict 2026-02-02 05:51:25 +00:00
Roland Tannous
023405c76a backend restructuring and housekeeping 2026-02-02 05:48:09 +00:00
Roland Tannous
2761c59012 Merge pull request #4 from unslothai/feature/backend-draft
Pushing the initial draft of the backend
2026-02-02 09:33:01 +04:00
sshah229
c042223a7a moved utils, dataset_utilsand datasets, updated the startTraining pydantic model 2026-02-01 16:49:42 -07:00
Roland Tannous
7b70d8fe70 Merge pull request #3 from unslothai/feature/frontendui-onboarding-dashboard
feat: onboarding & dashboard UI
2026-02-01 14:00:54 +04:00
sshah229
d593b069e2 Added the training and models routes 2026-02-01 01:23:16 -07:00
shine1i
aeb5382f0a feat: track and display reasoning duration, enhance runtime with adapter for copying during inference and edit and UI integration 2026-02-01 09:08:23 +01:00
shine1i
f05db56439 refactor: improve reasoning UI with animations and dynamic behavior, minor CSS and layout tweaks 2026-02-01 08:31:22 +01:00
shine1i
614500c117 refactor: chat input bg with fade, reuse it in composer view as well 2026-02-01 08:09:17 +01:00
shine1i
dea9cf1911 refactor: migrate chat sidebar and UI components to modular sidebar framework, some minor UI tweaks (sidebar, lines) 2026-02-01 07:50:53 +01:00
shine1i
cf0cda5b65 chore: update labels and UI minor adjustments for clarity 2026-02-01 06:57:15 +01:00
shine1i
52bd5ebebd feat: add frontend UI codebase 2026-01-31 19:34:16 +01:00
Datta Nimmaturi
2deb583389 [trl] vllm trl topk fixup (#3935)
* [transformers] [v5] remove unused hybridcache (#3910)

* remote unused hybridcache

* cleanup

* Fix top_k on trl GRPO

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Daniel Han <danielhanchen@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-31 06:34:07 -08:00
Roland Tannous
a30967a69c added __init__.py for backend 2026-01-31 08:38:29 +00:00
Roland Tannous
0ef09af008 git repo skeleton structure 2026-01-31 08:27:01 +00:00
Roland Tannous
b5aa137b7f first commit 2026-01-27 21:19:48 +04:00
Pádraic Slattery
a09bdb6adb chore: Update outdated GitHub Actions version (#3936) 2026-01-27 07:19:38 -08:00
pre-commit-ci[bot]
a34eb55ecd [pre-commit.ci] pre-commit autoupdate (#3937)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.13 → v0.14.14](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.13...v0.14.14)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-27 07:18:26 -08:00
Daniel Han
29edef68a8 Update pyproject.toml 2026-01-27 07:17:45 -08:00
pluesclues
3fde3a91ee Grpo compile settings update (#3927)
* Add torch compile options for GRPOTrainer

* Update CUDA settings based on device capability

* Add triton persistent TMA matmul condition

* Fix syntax for triton.enable_persistent_tma_matmul

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update rl.py

* Update rl.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-24 17:17:55 -08:00
Michael Han
f3efb70823 Embedding model fine-tuning support 2026-01-22 21:35:46 -08:00
Rachel Li
ca9cb26eed Guard torch.compile on ROCm when triton_key is missing (#3923)
* Guard torch.compile on ROCm when triton_key missing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update unsloth/import_fixes.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tighten ROCm Triton import handling

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Rachel Li <rachelliqx07@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-01-22 15:46:08 -08:00
Michael Han
08e07e7865 Embedding model support 2026-01-22 14:22:03 -08:00
Daniel Han
a78c6a62e4 Update vision.py 2026-01-22 07:40:51 -08:00
electroglyph
101ab17728 add FastSentenceTransformer for easily finetuning SentenceTransformer models (#3719)
* add FastSentenceTransformer

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Gemini code review suggestions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* unsloth-zoo patch only fixed usage for XLMRobertaForMaskedLM, this is a fix for XLMRobertaModel

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor do_lower_case

* add some comments

* force disable FP8 loading

* refactor pooling detection, add missing pooling types

* add save_pretrained_merged method which gets modules and config

* fix _save_pretrained_merged

* rename read_pooling_mode, load modules instead of hard-coding em

* comment

* revert save_pretrained_merged change

* propagate trust_remote_code properly

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add super hacky mpnet patch from hell

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor _load_modules, add for_inference to from_pretrained, add transformers 5 code for mpnet, add distilbert patches

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add ModernBert

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* deberta-v2 support (provisional), fix remote_code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add generic add_pooling_layer logic

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix for missing config

* add push_to_hub_merged

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* edit messages, throw exception if no HF token

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix device_map mismatch

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add comments, move import, other suggestions by Datta0

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* re-add adapter removal to save_pretrained_merged, but if saving to folder which had adapters before, leave them

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add unsloth branding to save_pretrained_merged

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* propagate dtype to internal module when loading for inference

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix mpnet gradient checkpointing for torch >= 2.9

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* same thing for transformers 5, oops =)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix FastSentenceTransformer performance: 6x speedup via torch.compile + SDPA

The original implementation was 31% slower than naive SentenceTransformer due to
conflicting decorators from Unsloth's auto-compiler (@torch.compile on attention
modules but @torch.compiler.disable on sub-modules).

Changes:
- Add fast encoder path that bypasses Unsloth patching for encoder models
- Use native torch.compile with mode="reduce-overhead" for 6x speedup
- Auto-detect and enable SDPA for models that support it (BERT, RoBERTa, etc.)
- Change defaults: load_in_16bit=True, load_in_4bit=False (16-bit is optimal)
- Change default: use_gradient_checkpointing=False (conflicts with torch.compile)
- Add UNSLOTH_COMPILE_DISABLE=1 env var to fall back to old path if needed

Supported encoder types: mpnet, bert, distilbert, roberta, xlm-roberta, albert, electra

Benchmark results (BS=32, seq_len=128):
- Naive 16-bit LoRA:     13-50ms per iter
- Unsloth 16-bit LoRA:   2-9ms per iter (5.4x-6.7x faster)
- Memory usage:          61MB-1.3GB (even largest model fits easily)

Note: 4-bit + torch.compile has a PyTorch bug (pytorch/pytorch#90665).
4-bit is also 1.7-1.9x slower than 16-bit due to dequantization overhead,
so 16-bit is recommended for these small encoder models anyway.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Use Unsloth's prepare_model_for_kbit_training for consistency

Changed from peft.prepare_model_for_kbit_training to
unsloth.models._utils.prepare_model_for_kbit_training.

Unsloth's version provides:
- Float32 mixed precision upcasting for LoRA layers
- Better numerical stability
- Consistency with rest of Unsloth codebase

* Use relative imports and add float16 machine support

- Changed absolute import to relative: from ._utils import prepare_model_for_kbit_training
- Added SUPPORTS_BFLOAT16 import for proper dtype detection
- Handle devices that don't support bfloat16 by falling back to float16

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add save_pretrained_torchao

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add auto-compile for torch.compile based on training step breakeven analysis

Changes:
- Change default compile_mode from "reduce-overhead" to "default" since CUDA
  Graphs (used by reduce-overhead) is incompatible with PEFT/LoRA
- Add _estimate_compile_threshold() to calculate minimum steps needed for
  torch.compile to be beneficial based on model parameter count
- Add _apply_torch_compile() helper with accelerate unwrap_model bug workaround
- Defer torch.compile application to trainer initialization time so we can
  check max_steps against the breakeven threshold
- Patch SentenceTransformerTrainer to auto-apply compile when max_steps
  exceeds the calculated threshold

Breakeven thresholds (with 1.2x safety margin):
- 22M params (MiniLM): ~1388 steps
- 110M params (mpnet): ~242 steps
- 335M params (snowflake): ~203 steps

This ensures torch.compile warmup cost is only paid when training is long
enough to benefit from the speedup.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* do QAT preparation for fast path

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix double loading model, thanks Etherl

* do mpnet gradient checkpoint patch if gc is enabled

* remove distilbert patches from mpnet fix

* sanity check on model params, thanks Etherl

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add save_pretrained_gguf, thanks Etherl

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refine compile threshold estimation for sentence transformers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Han <danielhanchen@gmail.com>
Co-authored-by: Daniel Han <danielhanchen@users.noreply.github.com>
2026-01-22 07:35:55 -08:00
Daniel Han
09ebbf6e63 Versioning 2026-01-22 07:33:59 -08:00
Roland Tannous
affd52e868 Merge pull request #49 from unslothai/feature/default-param-yaml
Yaml config for default parameters
2026-01-22 05:42:42 +04:00
sshah229
30c75e6d41 fixed parameters (finetune language, vision, attention layers, and mlp_modules) not updating 2026-01-21 02:40:25 -07:00
Daniel Han
509fd4227c Handle Transformers 5 vLLM import errors (#3908)
* Handle Transformers 5 vLLM import errors

* Deduplicate vLLM transformers mismatch handling

---------

Co-authored-by: danielhanchen <danielhanchen@users.noreply.github.com>
2026-01-20 01:02:39 -08:00
Roland Tannous
02982ceeba set create public gradio share link to true 2026-01-20 07:36:57 +00:00