Merge pull request #338 from unslothai/fix/trust-code

Exposed trust_remote_code through the UI
This commit is contained in:
Roland Tannous 2026-03-09 17:19:56 +04:00 committed by GitHub
commit 87c8d7b3da
92 changed files with 291 additions and 21 deletions

View file

@ -2,6 +2,7 @@
# Used for models without specific configurations
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -47,6 +48,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.7
top_p: 0.95
top_k: -1

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/ERNIE-4.5-21B-A3B-PT
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: true
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -48,6 +49,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: true
temperature: 1.5
min_p: 0.1

View file

@ -3,6 +3,7 @@
# Also applies to: tiiuae/Falcon-H1-0.5B-Instruct, unsloth/Falcon-H1-0.5B-Instruct
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from Ollama
training:
trust_remote_code: false
max_seq_length: 4096
# num_epochs: 4
num_epochs: 0
@ -44,5 +45,6 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0
top_p: 0.9

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 4096
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -2,6 +2,7 @@
# Based on Gemma2_(9B)-Alpaca.ipynb (same defaults for larger models)
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -41,3 +42,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/gemma-2-2b-bnb-4bit, google/gemma-2-2b
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 2
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 1024
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
audio_input: true
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 2
num_epochs: 0
@ -44,6 +45,7 @@ logging:
audio_input: true
inference:
trust_remote_code: false
temperature: 1.0
top_k: 64
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 4096
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_p: 1.0
top_k: 0

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 1024
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.0
top_p: 1.0
top_k: 0

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -46,6 +47,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.0
top_p: 1.0
top_k: 0

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -46,6 +47,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.0
top_p: 1.0
top_k: 0

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Llama-3.2-1B-Instruct-unsloth-bnb-4bit, meta-llama/Llama-3.2-1B-Instruct, unsloth/Llama-3.2-1B-Instruct-bnb-4bit, RedHatAI/Llama-3.2-1B-Instruct-FP8, unsloth/Llama-3.2-1B-Instruct-FP8-Block, unsloth/Llama-3.2-1B-Instruct-FP8-Dynamic
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 5
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Meta-Llama-3.1-8B-bnb-4bit, unsloth/Meta-Llama-3.1-8B-unsloth-bnb-4bit, meta-llama/Meta-Llama-3.1-8B, unsloth/Meta-Llama-3.1-8B, unsloth/Meta-Llama-3.1-70B, meta-llama/Meta-Llama-3.1-70B, unsloth/Meta-Llama-3.1-405B-bnb-4bit, meta-llama/Meta-Llama-3.1-405B
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: "unsloth/Meta-Llama-3.1-8B-Instruct-unsloth-bnb-4bit", "meta-llama/Meta-Llama-3.1-8B-Instruct", "unsloth/Meta-Llama-3.1-8B-Instruct","RedHatAI/Llama-3.1-8B-Instruct-FP8","unsloth/Llama-3.1-8B-Instruct-FP8-Block","unsloth/Llama-3.1-8B-Instruct-FP8-Dynamic"
training:
trust_remote_code: false
max_seq_length: 8192
# num_epochs: 4
num_epochs: 0
@ -42,4 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/llama-3-8b-Instruct, meta-llama/Meta-Llama-3-8B-Instruct
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/llama-3-8b, meta-llama/Meta-Llama-3-8B
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -39,6 +40,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.2
top_p: 1.2

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -48,6 +49,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.7
min_p: 0.01
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -48,6 +49,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.15
top_p: default

View file

@ -3,6 +3,7 @@
# Also applies to: "unsloth/Mistral-Nemo-Base-2407", "mistralai/Mistral-Nemo-Base-2407", "unsloth/Mistral-Nemo-Instruct-2407-bnb-4bit", "unsloth/Mistral-Nemo-Instruct-2407", "mistralai/Mistral-Nemo-Instruct-2407",
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,4 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Mistral-Small-Instruct-2409-bnb-4bit, mistralai/Mistral-Small-Instruct-2409
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/mistral-7b-instruct-v0.3, mistralai/Mistral-7B-Instruct-v0.3
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,4 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -2,6 +2,7 @@
# Based on Mistral_v0.3_(7B)-Alpaca.ipynb
# Also applies to: "unsloth/mistral-7b-v0.3", "mistralai/Mistral-7B-v0.3",
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -41,4 +42,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -6,6 +6,7 @@
audio_type: dac
training:
trust_remote_code: false
eval_steps: 0
max_seq_length: 2048
# num_epochs: 4
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.4
top_k: 40
top_p: 0.9

View file

@ -6,6 +6,7 @@
audio_type: bicodec
training:
trust_remote_code: false
eval_steps: 0
max_seq_length: 2048
# num_epochs: 4
@ -47,6 +48,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.8
top_k: 50
top_p: 1.0

View file

@ -5,6 +5,7 @@
audio_type: csm
training:
trust_remote_code: false
eval_steps: 0
max_seq_length: 2048
# num_epochs: 4
@ -45,3 +46,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/GLM-4.7-Flash-unsloth-bnb-4bit, unsloth/GLM-4.7-Flash-bnb-4bit, THUDM/GLM-4.7-Flash
training:
trust_remote_code: true
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: true
temperature: 0.7
top_p: 0.8
top_k: 20

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -38,6 +39,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.3
min_p: 0.15

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: true
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -46,6 +47,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: true
temperature: 1.0
top_p: 1.0

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: true
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -48,6 +49,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: true
temperature: 1.5
min_p: 0.1

View file

@ -2,6 +2,7 @@
# Based on bert_classification.ipynb
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 1
num_epochs: 0
@ -41,3 +42,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -6,6 +6,7 @@
audio_type: snac
training:
trust_remote_code: false
eval_steps: 0
max_seq_length: 2048
# num_epochs: 4
@ -47,6 +48,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_p: 0.95

View file

@ -3,6 +3,7 @@
# Also applies to: TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T
training:
trust_remote_code: false
max_seq_length: 4096
# num_epochs: 1
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -6,6 +6,7 @@ audio_type: whisper
audio_input: true
training:
trust_remote_code: false
eval_steps: 5
max_seq_length: 448
# num_epochs: 4
@ -41,3 +42,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: "unsloth/Phi-3-medium-4k-instruct-bnb-4bit", "microsoft/Phi-3-medium-4k-instruct",
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,4 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: "unsloth/Phi-3.5-mini-instruct-bnb-4bit", "microsoft/Phi-3.5-mini-instruct"
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,4 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.8
top_p: 0.95

View file

@ -4,6 +4,7 @@
# MoE model - includes gate_up_proj for MoE layers
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -45,6 +46,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_k: 20
top_p: 0.95

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Qwen2-7B-bnb-4bit, Qwen/Qwen2-7B
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Qwen2.5-1.5B-Instruct-unsloth-bnb-4bit, Qwen/Qwen2.5-1.5B-Instruct, unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit
training:
trust_remote_code: false
max_seq_length: 4096
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Qwen2.5-7B-unsloth-bnb-4bit, Qwen/Qwen2.5-7B, unsloth/Qwen2.5-7B-bnb-4bit
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit, Qwen/Qwen2.5-Coder-1.5B-Instruct
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -3,6 +3,7 @@
# Also applies to: unsloth/Qwen2.5-Coder-7B-Instruct, Qwen/Qwen2.5-Coder-7B-Instruct
training:
trust_remote_code: false
max_seq_length: 32768
# num_epochs: 4
num_epochs: 0
@ -42,3 +43,5 @@ logging:
tensorboard_dir: "runs"
log_frequency: 10
inference:
trust_remote_code: false

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth notebook
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 1.5
min_p: 0.1

View file

@ -4,6 +4,7 @@
# added inference parameters from Ollama
training:
trust_remote_code: false
max_seq_length: 1024
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_k: 20
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from Ollama
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_k: 20
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from Ollama
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_k: 20
top_p: 0.95

View file

@ -4,6 +4,7 @@
# MoE model - includes gate_up_proj for MoE layers
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -45,6 +46,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_k: 20
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from Ollama
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_k: 20
top_p: 0.95

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.7
top_p: 0.80
top_k: 20

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -44,6 +45,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.6
top_p: 0.95
top_k: 20

View file

@ -4,6 +4,7 @@
# added inference parameters from unsloth guides
training:
trust_remote_code: false
max_seq_length: 2048
# num_epochs: 4
num_epochs: 0
@ -42,6 +43,7 @@ logging:
log_frequency: 10
inference:
trust_remote_code: false
temperature: 0.7
top_p: 0.8
top_k: 20

View file

@ -138,7 +138,8 @@ class ExportBackend:
def load_checkpoint(self,
checkpoint_path: str,
max_seq_length: int = 2048,
load_in_4bit: bool = True) -> Tuple[bool, str]:
load_in_4bit: bool = True,
trust_remote_code: bool = False) -> Tuple[bool, str]:
"""
Load a checkpoint for export.
@ -178,6 +179,7 @@ class ExportBackend:
dtype=None,
auto_model=CsmForConditionalGeneration,
load_in_4bit=False,
trust_remote_code=trust_remote_code,
)
elif self._audio_type == 'whisper':
@ -189,6 +191,7 @@ class ExportBackend:
dtype=None,
load_in_4bit=False,
auto_model=WhisperForConditionalGeneration,
trust_remote_code=trust_remote_code,
)
elif self._audio_type == 'snac':
@ -198,6 +201,7 @@ class ExportBackend:
max_seq_length=max_seq_length,
dtype=None,
load_in_4bit=load_in_4bit,
trust_remote_code=trust_remote_code,
)
elif self._audio_type == 'bicodec':
@ -208,6 +212,7 @@ class ExportBackend:
max_seq_length=max_seq_length,
dtype=torch.float32,
load_in_4bit=False,
trust_remote_code=trust_remote_code,
)
elif self._audio_type == 'dac':
@ -217,6 +222,7 @@ class ExportBackend:
model_name=checkpoint_path,
max_seq_length=max_seq_length,
load_in_4bit=False,
trust_remote_code=trust_remote_code,
)
elif self.is_vision:
@ -226,6 +232,7 @@ class ExportBackend:
max_seq_length=max_seq_length,
dtype=None,
load_in_4bit=load_in_4bit,
trust_remote_code=trust_remote_code,
)
tokenizer = processor # For vision models, processor acts as tokenizer
@ -236,6 +243,7 @@ class ExportBackend:
max_seq_length=max_seq_length,
dtype=None,
load_in_4bit=load_in_4bit,
trust_remote_code=trust_remote_code,
)
# Check if PEFT model

View file

@ -211,6 +211,7 @@ class ExportOrchestrator:
checkpoint_path: str,
max_seq_length: int = 2048,
load_in_4bit: bool = True,
trust_remote_code: bool = False,
) -> Tuple[bool, str]:
"""Load a checkpoint for export.
@ -225,6 +226,7 @@ class ExportOrchestrator:
"checkpoint_path": checkpoint_path,
"max_seq_length": max_seq_length,
"load_in_4bit": load_in_4bit,
"trust_remote_code": trust_remote_code,
}
# Always kill existing subprocess and spawn fresh.

View file

@ -84,6 +84,7 @@ def _handle_load(backend, cmd: dict, resp_queue: Any) -> None:
checkpoint_path = cmd["checkpoint_path"]
max_seq_length = cmd.get("max_seq_length", 2048)
load_in_4bit = cmd.get("load_in_4bit", True)
trust_remote_code = cmd.get("trust_remote_code", False)
try:
_send_response(resp_queue, {
@ -96,6 +97,7 @@ def _handle_load(backend, cmd: dict, resp_queue: Any) -> None:
checkpoint_path=checkpoint_path,
max_seq_length=max_seq_length,
load_in_4bit=load_in_4bit,
trust_remote_code=trust_remote_code,
)
_send_response(resp_queue, {

View file

@ -63,7 +63,8 @@ class InferenceBackend:
max_seq_length: int = 2048,
dtype = None,
load_in_4bit: bool = True,
hf_token: Optional[str] = None) -> bool:
hf_token: Optional[str] = None,
trust_remote_code: bool = False) -> bool:
"""
Load any model: base, LoRA adapter, text, or vision.
"""
@ -110,6 +111,7 @@ class InferenceBackend:
auto_model=CsmForConditionalGeneration,
load_in_4bit=False,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
FastModel.for_inference(model)
self.models[model_name]["model"] = model
@ -139,6 +141,7 @@ class InferenceBackend:
dtype=torch.float32,
load_in_4bit=False,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
else:
# Base model: download full HF repo, then load from /LLM subfolder
@ -155,6 +158,7 @@ class InferenceBackend:
dtype=torch.float32,
load_in_4bit=False,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
FastModel.for_inference(model)
@ -169,6 +173,7 @@ class InferenceBackend:
max_seq_length=max_seq_length,
load_in_4bit=False,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
FastModel.for_inference(model)
self.models[model_name]["model"] = model
@ -184,6 +189,7 @@ class InferenceBackend:
whisper_task="transcribe",
load_in_4bit=False,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
FastModel.for_inference(model)
model.eval()
@ -209,6 +215,7 @@ class InferenceBackend:
max_seq_length=max_seq_length,
load_in_4bit=False,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
FastLanguageModel.for_inference(model)
self.models[model_name]["model"] = model
@ -240,6 +247,7 @@ class InferenceBackend:
dtype=dtype,
load_in_4bit=load_in_4bit,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
# Apply inference optimization
@ -270,6 +278,7 @@ class InferenceBackend:
processor = AutoProcessor.from_pretrained(
processor_source,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
logger.info(f"Loaded {type(processor).__name__} from {processor_source}")
@ -285,6 +294,7 @@ class InferenceBackend:
dtype=dtype,
load_in_4bit=load_in_4bit,
token=hf_token if hf_token and hf_token.strip() else None,
trust_remote_code=trust_remote_code,
)
# Apply inference optimization

View file

@ -258,6 +258,7 @@ class InferenceOrchestrator:
dtype=None,
load_in_4bit: bool = True,
hf_token: Optional[str] = None,
trust_remote_code: bool = False,
) -> bool:
"""Load a model for inference.
@ -282,6 +283,7 @@ class InferenceOrchestrator:
"load_in_4bit": load_in_4bit,
"hf_token": hf_token or "",
"gguf_variant": getattr(config, "gguf_variant", None),
"trust_remote_code": trust_remote_code,
}
# Always kill existing subprocess and spawn fresh.

View file

@ -155,6 +155,7 @@ def _handle_load(backend, config: dict, resp_queue: Any) -> None:
max_seq_length=config.get("max_seq_length", 2048),
load_in_4bit=load_in_4bit,
hf_token=hf_token,
trust_remote_code=config.get("trust_remote_code", False),
)
if success:

View file

@ -329,9 +329,11 @@ class UnslothTrainer:
load_in_4bit: bool = True,
hf_token: Optional[str] = None,
is_dataset_image: bool = False,
is_dataset_audio: bool = False) -> bool:
is_dataset_audio: bool = False,
trust_remote_code: bool = False) -> bool:
"""Load model for training (supports both text and vision models)"""
self.load_in_4bit = load_in_4bit # Store for training_meta.json
self.trust_remote_code = trust_remote_code # For AutoProcessor etc. used during training
try:
if self.model is not None:
del self.model
@ -450,6 +452,7 @@ class UnslothTrainer:
auto_model=CsmForConditionalGeneration,
load_in_4bit=False,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info("Loaded CSM audio model")
@ -465,6 +468,7 @@ class UnslothTrainer:
whisper_language="English",
whisper_task="transcribe",
token=hf_token,
trust_remote_code=trust_remote_code,
)
# Configure generation settings (notebook lines 100-105)
self.model.generation_config.language = "<|en|>"
@ -481,6 +485,7 @@ class UnslothTrainer:
dtype=None,
load_in_4bit=load_in_4bit,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info(f"Loaded {self._audio_type} audio model (FastLanguageModel)")
@ -514,6 +519,7 @@ class UnslothTrainer:
dtype=torch.float32, # Spark-TTS requires float32
load_in_4bit=False,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info("Loaded Spark-TTS (bicodec) model")
@ -525,6 +531,7 @@ class UnslothTrainer:
max_seq_length=max_seq_length,
load_in_4bit=False,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info("Loaded OuteTTS (dac) model (FastModel)")
@ -538,6 +545,7 @@ class UnslothTrainer:
dtype=None,
load_in_4bit=load_in_4bit,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info("Loaded audio VLM model (FastModel)")
@ -549,6 +557,7 @@ class UnslothTrainer:
dtype=None, # Auto-detect
load_in_4bit=load_in_4bit,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info("Loaded vision model")
@ -568,6 +577,7 @@ class UnslothTrainer:
dtype=None, # Auto-detect
load_in_4bit=load_in_4bit,
token=hf_token,
trust_remote_code=trust_remote_code,
)
logger.info("Loaded text model")
@ -588,7 +598,7 @@ class UnslothTrainer:
self._source_code_retried = True
print(f"\n'could not get source code' — retrying once...\n")
return self.load_model(model_name, max_seq_length, load_in_4bit, hf_token,
is_dataset_image, is_dataset_audio)
is_dataset_image, is_dataset_audio, trust_remote_code)
error_msg = str(e)
error_lower = error_msg.lower()
if any(k in error_lower for k in ("gated repo", "access to it at", "401", "403", "unauthorized", "forbidden")):
@ -987,7 +997,10 @@ class UnslothTrainer:
from datasets import Audio
import torch
processor = AutoProcessor.from_pretrained(self.model_name)
processor = AutoProcessor.from_pretrained(
self.model_name,
trust_remote_code=getattr(self, "trust_remote_code", False),
)
# Strip pad_to_multiple_of from tokenizer init_kwargs — fine-tuned models
# (e.g. keanteng/sesame-csm-elise) save it in tokenizer_config.json, and

View file

@ -176,6 +176,7 @@ class TrainingBackend:
"wandb_project": kwargs.get("wandb_project", "unsloth-training"),
"enable_tensorboard": kwargs.get("enable_tensorboard", False),
"tensorboard_dir": kwargs.get("tensorboard_dir", "runs"),
"trust_remote_code": kwargs.get("trust_remote_code", False),
}
# Derive load_in_4bit from training_type

View file

@ -192,14 +192,16 @@ def run_training_process(
hf_token=hf_token,
is_dataset_image=config.get("is_dataset_image", False),
is_dataset_audio=config.get("is_dataset_audio", False),
trust_remote_code=config.get("trust_remote_code", False),
)
if not success or trainer.should_stop:
if trainer.should_stop:
event_queue.put({"type": "complete", "output_dir": None, "ts": time.time()})
else:
error_msg = trainer.training_progress.error or "Failed to load model"
event_queue.put({
"type": "error",
"error": trainer.training_progress.error or "Failed to load model",
"error": error_msg,
"stack": "", "ts": time.time(),
})
return

View file

@ -19,6 +19,10 @@ class LoadCheckpointRequest(BaseModel):
True,
description="Whether to load the model in 4-bit quantization",
)
trust_remote_code: bool = Field(
False,
description="Allow loading models with custom code. Only enable for checkpoints/base models you trust.",
)
class ExportStatusResponse(BaseModel):

View file

@ -18,6 +18,10 @@ class LoadRequest(BaseModel):
load_in_4bit: bool = Field(True, description="Load model in 4-bit quantization")
is_lora: bool = Field(False, description="Whether this is a LoRA adapter")
gguf_variant: Optional[str] = Field(None, description="GGUF quantization variant (e.g. 'Q4_K_M')")
trust_remote_code: bool = Field(
False,
description="Allow loading models with custom code (e.g. NVIDIA Nemotron). Only enable for repos you trust.",
)
class UnloadRequest(BaseModel):

View file

@ -13,6 +13,10 @@ class TrainingStartRequest(BaseModel):
hf_token: Optional[str] = Field(None, description="HuggingFace token")
load_in_4bit: bool = Field(True, description="Load model in 4-bit quantization")
max_seq_length: int = Field(2048, description="Maximum sequence length")
trust_remote_code: bool = Field(
False,
description="Allow loading models with custom code (e.g. NVIDIA Nemotron). Only enable for repos you trust.",
)
# Dataset parameters
hf_dataset: Optional[str] = Field(None, description="HuggingFace dataset identifier")

View file

@ -102,6 +102,7 @@ async def load_checkpoint(
checkpoint_path=request.checkpoint_path,
max_seq_length=request.max_seq_length,
load_in_4bit=request.load_in_4bit,
trust_remote_code=request.trust_remote_code,
)
if not success:

View file

@ -26,6 +26,7 @@ try:
from core.inference.llama_cpp import LlamaCppBackend
from utils.models import ModelConfig
from utils.inference import load_inference_config
from utils.models.model_config import load_model_defaults
except ImportError:
parent_backend = backend_path.parent / "backend"
if str(parent_backend) not in sys.path:
@ -34,6 +35,7 @@ except ImportError:
from core.inference.llama_cpp import LlamaCppBackend
from utils.models import ModelConfig
from utils.inference import load_inference_config
from utils.models.model_config import load_model_defaults
from models.inference import (
LoadRequest,
@ -228,9 +230,22 @@ async def load_model(
max_seq_length=request.max_seq_length,
load_in_4bit=load_in_4bit,
hf_token=request.hf_token,
trust_remote_code=request.trust_remote_code,
)
if not success:
# Check if YAML says this model needs trust_remote_code
if not request.trust_remote_code:
model_defaults = load_model_defaults(config.identifier)
yaml_trust = model_defaults.get("inference", {}).get("trust_remote_code", False)
if yaml_trust:
raise HTTPException(
status_code=400,
detail=(
f"Model '{config.display_name}' requires trust_remote_code to be enabled. "
f"Please enable 'Trust remote code' in Chat Settings and try again."
),
)
raise HTTPException(
status_code=500,
detail=f"Failed to load model: {config.display_name}"

View file

@ -19,12 +19,14 @@ if str(backend_path) not in sys.path:
# Import backend functions
try:
from core.training import get_training_backend
from utils.models.model_config import load_model_defaults
except ImportError:
# Fallback: try to import from parent directory
parent_backend = backend_path.parent / "backend"
if str(parent_backend) not in sys.path:
sys.path.insert(0, str(parent_backend))
from core.training import get_training_backend
from utils.models.model_config import load_model_defaults
# Auth
from auth.authentication import get_current_subject
@ -200,8 +202,19 @@ async def start_training(
"wandb_project": request.wandb_project or "",
"enable_tensorboard": request.enable_tensorboard,
"tensorboard_dir": request.tensorboard_dir or "",
"trust_remote_code": request.trust_remote_code,
}
# Training page has no trust_remote_code toggle — the value comes from
# YAML model defaults applied when the user selects a model. As a safety
# net, consult the YAML directly so models that need it always get it.
if not training_kwargs["trust_remote_code"]:
model_defaults = load_model_defaults(request.model_name)
yaml_trust = model_defaults.get("training", {}).get("trust_remote_code", False)
if yaml_trust:
logger.info(f"YAML config sets trust_remote_code=True for {request.model_name}")
training_kwargs["trust_remote_code"] = True
# Free GPU memory: shut down any running inference/export subprocesses
# before training starts (they'd compete for VRAM otherwise)
try:

View file

@ -59,6 +59,7 @@ def load_inference_config(model_identifier: str) -> Dict[str, Any]:
"top_p": model_inference.get("top_p", default_inference.get("top_p", 0.95)),
"top_k": model_inference.get("top_k", default_inference.get("top_k", -1)),
"min_p": model_inference.get("min_p", default_inference.get("min_p", 0.01)),
"trust_remote_code": model_inference.get("trust_remote_code", default_inference.get("trust_remote_code", False)),
}
return inference_config

View file

@ -114,6 +114,7 @@ export const DEFAULT_HYPERPARAMS = {
enableTensorboard: false,
tensorboardDir: "runs",
logFrequency: 10,
trustRemoteCode: false,
finetuneVisionLayers: true,
finetuneLanguageLayers: true,
finetuneAttentionModules: true,

View file

@ -170,6 +170,7 @@ export function ChatSettingsPanel({
...p.params,
systemPrompt: params.systemPrompt,
checkpoint: params.checkpoint,
trustRemoteCode: params.trustRemoteCode,
});
setActivePreset(name);
}
@ -330,17 +331,31 @@ export function ChatSettingsPanel({
</CollapsibleSection>
<CollapsibleSection icon={Settings02Icon} label="Settings">
<div className="flex items-center justify-between gap-3 py-1">
<div className="min-w-0">
<div className="text-xs font-medium">Auto title</div>
<div className="text-[11px] text-muted-foreground">
Generate short title after reply.
<div className="flex flex-col gap-3 py-1">
<div className="flex items-center justify-between gap-3">
<div className="min-w-0">
<div className="text-xs font-medium">Auto title</div>
<div className="text-[11px] text-muted-foreground">
Generate short title after reply.
</div>
</div>
<Switch
checked={autoTitle}
onCheckedChange={onAutoTitleChange}
/>
</div>
<div className="flex items-center justify-between gap-3">
<div className="min-w-0">
<div className="text-xs font-medium">Trust remote code</div>
<div className="text-[11px] text-muted-foreground">
Allow models with custom code (e.g. Nemotron). Only enable for repos you trust.
</div>
</div>
<Switch
checked={params.trustRemoteCode ?? false}
onCheckedChange={set("trustRemoteCode")}
/>
</div>
<Switch
checked={autoTitle}
onCheckedChange={onAutoTitleChange}
/>
</div>
</CollapsibleSection>
</div>

View file

@ -124,6 +124,10 @@ function mergeRecommendedInference(
topP: toFiniteNumber(inference?.top_p) ?? current.topP,
topK: toFiniteNumber(inference?.top_k) ?? current.topK,
minP: toFiniteNumber(inference?.min_p) ?? current.minP,
trustRemoteCode:
typeof inference?.trust_remote_code === "boolean"
? inference.trust_remote_code
: current.trustRemoteCode,
};
}
@ -232,6 +236,7 @@ export function useChatModelRuntime() {
previousWasUnloaded = true;
}
const paramsBeforeLoad = useChatRuntimeStore.getState().params;
const loadResponse = await loadModel({
model_path: modelId,
hf_token: null,
@ -239,6 +244,7 @@ export function useChatModelRuntime() {
load_in_4bit: true,
is_lora: isLora,
gguf_variant: ggufVariant ?? null,
trust_remote_code: paramsBeforeLoad.trustRemoteCode ?? false,
});
const currentParams = useChatRuntimeStore.getState().params;

View file

@ -34,6 +34,8 @@ export interface LoadModelRequest {
load_in_4bit: boolean;
is_lora: boolean;
gguf_variant?: string | null;
/** Allow loading models with custom code (e.g. NVIDIA Nemotron). Only enable for repos you trust. */
trust_remote_code?: boolean;
}
export interface ValidateModelResponse {
@ -74,6 +76,7 @@ export interface LoadModelResponse {
top_p?: number;
top_k?: number;
min_p?: number;
trust_remote_code?: boolean;
};
}

View file

@ -7,6 +7,8 @@ export interface InferenceParams {
maxTokens: number;
systemPrompt: string;
checkpoint: string;
/** Allow loading models with custom code (e.g. NVIDIA Nemotron). Only enable for repos you trust. */
trustRemoteCode?: boolean;
}
export const DEFAULT_INFERENCE_PARAMS: InferenceParams = {
@ -18,6 +20,7 @@ export const DEFAULT_INFERENCE_PARAMS: InferenceParams = {
maxTokens: 4092,
systemPrompt: "",
checkpoint: "",
trustRemoteCode: false,
};
export interface ChatModelSummary {

View file

@ -50,6 +50,8 @@ export async function loadCheckpoint(params: {
checkpoint_path: string;
max_seq_length?: number;
load_in_4bit?: boolean;
/** Allow loading models with custom code. Only enable for checkpoints you trust. */
trust_remote_code?: boolean;
}): Promise<ExportOperationResponse> {
const response = await authFetch("/api/export/load-checkpoint", {
method: "POST",

View file

@ -36,6 +36,7 @@ export function buildTrainingStartPayload(
hf_token: config.hfToken.trim() || null,
load_in_4bit: adapterMethod ? isQloraMethod : false,
max_seq_length: config.contextLength,
trust_remote_code: config.trustRemoteCode ?? false,
hf_dataset: hfDataset,
subset: hfDataset ? config.datasetSubset : null,
train_split: hfDataset ? config.datasetSplit : null,

View file

@ -22,6 +22,7 @@ interface BackendTrainingDefaults {
packing?: boolean;
train_on_completions?: boolean;
gradient_checkpointing?: "none" | "true" | "unsloth";
trust_remote_code?: boolean;
}
interface BackendLoraDefaults {

View file

@ -30,6 +30,7 @@ type ModelDefaultsPatch = Partial<
| "tensorboardDir"
| "logFrequency"
| "finetuneVisionLayers"
| "trustRemoteCode"
| "finetuneLanguageLayers"
| "finetuneAttentionModules"
| "finetuneMLPModules"
@ -133,6 +134,9 @@ export function mapBackendModelConfigToTrainingPatch(
patch.gradientCheckpointing = gradientCheckpointing;
}
const trustRemoteCode = toBoolean(training?.trust_remote_code);
if (trustRemoteCode !== undefined) patch.trustRemoteCode = trustRemoteCode;
const loraRank = toNumber(lora?.lora_r);
if (loraRank !== undefined) patch.loraRank = loraRank;

View file

@ -4,6 +4,8 @@ export interface TrainingStartRequest {
hf_token: string | null;
load_in_4bit: boolean;
max_seq_length: number;
/** Allow loading models with custom code. Only enable for repos you trust. */
trust_remote_code?: boolean;
hf_dataset: string | null;
subset: string | null;
train_split: string | null;

View file

@ -63,6 +63,7 @@ export interface TrainingConfigState {
isCheckingDataset: boolean;
isDatasetImage: boolean | null;
isDatasetAudio: boolean;
trustRemoteCode: boolean;
finetuneVisionLayers: boolean;
finetuneLanguageLayers: boolean;
finetuneAttentionModules: boolean;