Add end-to-end embedding/sentence-transformer training pipeline using FastSentenceTransformer, SentenceTransformerTrainer, and MultipleNegativesRankingLoss with BatchSamplers.NO_DUPLICATES. Backend: - Add is_embedding_model() detection via HF tags + pipeline_tag - Add /check-embedding/ API route and EmbeddingCheckResponse - Extend derive_model_type() to return "embeddings" - Add _run_embedding_training() in worker.py with progress callbacks, stop handling, LoRA (task_type=FEATURE_EXTRACTION), and model saving - Add is_embedding field to TrainingStartRequest and ModelDetails - Add YAML configs for 5 models: all-MiniLM-L6-v2, bge-m3, embeddinggemma-300m, gte-modernbert-base, Qwen3-Embedding-0.6B Frontend: - Wire isEmbeddingModel flag through store, API types, and mappers - Force packing=false, train_on_completions=false, warmup_ratio=0.03 - Hide packing and train_on_completions checkboxes for embedding models - Auto-set modelType to "embeddings" from backend model_type response
39 lines
770 B
YAML
39 lines
770 B
YAML
# Model defaults for unsloth/bge-m3
|
|
# Based on BGE_M3.py embedding notebook
|
|
|
|
training:
|
|
max_seq_length: 512
|
|
# num_epochs: 2
|
|
num_epochs: 0
|
|
learning_rate: 3e-5
|
|
batch_size: 256
|
|
gradient_accumulation_steps: 1
|
|
warmup_ratio: 0.03
|
|
max_steps: 30
|
|
save_steps: 30
|
|
weight_decay: 0.01
|
|
random_seed: 3407
|
|
packing: false
|
|
train_on_completions: false
|
|
gradient_checkpointing: false
|
|
optim: "adamw_8bit"
|
|
lr_scheduler_type: "constant_with_warmup"
|
|
|
|
lora:
|
|
lora_r: 32
|
|
lora_alpha: 64
|
|
lora_dropout: 0.0
|
|
target_modules:
|
|
- "key"
|
|
- "query"
|
|
- "dense"
|
|
- "value"
|
|
use_rslora: false
|
|
use_loftq: false
|
|
|
|
logging:
|
|
enable_wandb: false
|
|
wandb_project: "embedding-finetuning"
|
|
enable_tensorboard: false
|
|
tensorboard_dir: "runs"
|
|
log_frequency: 50
|