| dragon_train | R Documentation |
Writes a run directory, then launches the trainer as a background Python
process. Returns immediately unless wait = TRUE. The run survives the R
session; reopen it later with dragon_run().
dragon_train(
dataset,
model,
lora = dragon_lora(),
args = dragon_train_args(),
hardware = dragon_hardware(),
name = NULL,
run_dir = NULL,
runs_dir = dragon_runs_dir(),
n_samples = 10,
revision = NULL,
trust_remote_code = FALSE,
wait = FALSE
)
dataset |
A mapped |
model |
A Hugging Face model id such as
|
lora |
LoRA settings from |
args |
Training settings from |
hardware |
Hardware settings from |
name |
Short label used in the run id. Defaults to the model name. |
run_dir |
Exact directory to use. Defaults to a timestamped directory
under |
runs_dir |
Parent directory for runs. See |
n_samples |
Number of held-out rows to generate sample replies for at the end of training. |
revision |
Model revision (branch, tag, or commit) on the Hub. |
trust_remote_code |
Allow the model repository to run custom code. |
wait |
Block until training finishes. |
A dragon_run object.
if (interactive()) {
run <- dragon_dataset(dragon_example_data()) |>
dragon_map(prompt = "{subject}\n\n{body}", response = "reply") |>
dragon_train("HuggingFaceTB/SmolLM2-135M-Instruct", wait = TRUE)
dragon_generate(run, "My order arrived damaged.")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.