Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:FlagOpen FlagEmbedding EmbedderRunner Run

From Leeroopedia
Revision as of 14:58, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/FlagOpen_FlagEmbedding_EmbedderRunner_Run.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Template:Metadata

Overview

API documentation for the run() method of AbsEmbedderRunner and its concrete implementations.

Concrete Runners

EncoderOnlyEmbedderRunner
FlagEmbedding/finetune/embedder/encoder_only/base/runner.py
DecoderOnlyEmbedderRunner
FlagEmbedding/finetune/embedder/decoder_only/base/runner.py

CLI Invocation

torchrun --nproc_per_node 4 \
    -m FlagEmbedding.finetune.embedder.encoder_only.base \
    --model_name_or_path BAAI/bge-base-en-v1.5 \
    --train_data ./train_data.jsonl \
    --output_dir ./fine_tuned_model \
    --learning_rate 1e-5 \
    --num_train_epochs 5 \
    --per_device_train_batch_size 32 \
    --temperature 0.02 \
    --deepspeed ds_stage0.json

run() Method Signature

def run(self):
    """Executes the training process."""
    Path(self.training_args.output_dir).mkdir(parents=True, exist_ok=True)
    self.trainer.train(resume_from_checkpoint=self.training_args.resume_from_checkpoint)
    self.trainer.save_model()

I/O

Input
Training JSONL file, model checkpoint, DeepSpeed config JSON.
Output
Fine-tuned model saved to output_dir.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment