Skip to main content
You don’t have to rewrite a model to train it on tracebloc. From your own notebook, pass the model you already have to user.upload_model(): the SDK recognises it, converts it into the model file the platform trains, checks that the converted model is still yours, and uploads it. A model file that already passes the upload checks is uploaded unchanged. For protein, DNA, molecule, pathology and omics models, see Models for bioinformatics.

What you can bring

The use case decides the task. A pretrained model always fine-tunes for the use case’s task: its backbone keeps its weights and, for a task with classes, a new head is built for the use case’s classes.

Install the training versions

Conversion runs on your machine, with the same library versions training uses. Install the SDK with the training extra, on Python 3.11, 3.12 or 3.13:
The training extra installs exactly the versions of torch, transformers, timm, scikit-learn and the other training libraries that the training images run. When yours differ, conversion stops, names each library with both versions, and tells you to install the training versions. Use a fresh virtual environment, so the extra doesn’t change the libraries your other projects use.

Upload your model

Sign in, then upload your model with the use case’s dataset key as dataset_id. The dataset key is on the use case’s Overview, under Start training. It tells the SDK the use case’s task and its number of classes:
Here esm2_t6_8M is a Hugging Face folder. The SDK:
  1. Recognises the model, reads its licence and asks you to confirm it.
  2. Writes the converted model next to yours, in esm2_t6_8M_tracebloc/: the model file, its weights as SafeTensors, the tokenizer for a text model, and the conversion report tracebloc_conversion.json.
  3. Runs the acceptance check on the converted model.
  4. Uploads the converted model, and prints Licence: MIT (from README.md license); confirmed by … and that the upload was successful.
Your own model is never changed. Upload the same model again and the SDK converts it again into the same folder.

Confirm the licence

The SDK reads the model’s licence from its model card or licence file and, in a notebook, asks:
When no licence is found, the sentence is I own these weights, or may use them in a data owner's secure environment. Your confirmation is recorded in the conversion report with your name and the time. Outside a notebook, nothing is asked. Confirm in the call instead:
Without a confirmation, the converted model is not uploaded, and the SDK says to pass licence_confirmed=True. Weights whose licence forbids redistributing them, such as CC-BY-ND or CC-BY-NC-ND, are stopped before anything uploads:
Non-commercial (NC) and share-alike (SA) licences upload once you confirm.

Your own code

Point upload_model at the folder with your model’s Python files, and its checkpoint if it has one:
The SDK finds your model class, reads its constructor’s values from the checkpoint, your config files, your training script’s arguments or the constructor’s defaults, and generates a model file that builds it. Your files are not changed: the converted model carries a copy of the code your model needs. When your model takes the number of classes as a constructor argument, such as num_classes, the converted model sets it to the use case’s. A text model needs its tokenizer. When your folder doesn’t carry one, pass the model’s tokenizer.json:
Your code may import only the allowed imports of the use case’s task. Imports your model doesn’t use are left out of the copy.

The acceptance check

The converted model is uploaded only when it passes the acceptance check. The check:
  • confirms the training libraries on your machine are the training versions;
  • builds the converted model and counts its parameters;
  • loads your weights into it strictly, every name and shape matching, with only the new head starting fresh;
  • compares its output with your original model’s on a fixed input: exact, within tolerance, or shapes only when the original can’t be built on your machine;
  • for a text model, checks that the converted tokenizer gives the same token ids as yours.
The conversion report, tracebloc_conversion.json, lists every value of the model file with where it came from (the model, a file in your repository, the dataset, or a default), the files written, each finding of the acceptance check, and the licence with your confirmation. When the check fails, the SDK says so and names the report.

When a model can’t be converted

Conversion stops before anything uploads, with one line that names the file or package, the reason and what to bring instead. The lines the SDK prints include: Models without Python source, such as TorchScript or ONNX files, compiled code, and models only a registry can build can’t be converted either: bring the Python code that defines the model, with its weights as a checkpoint.

Size limits

Each round, federated averaging merges the model’s full weights, and it merges models of up to 705M parameters. An experiment whose PyTorch model is larger is refused when you start it, before anything trains:
A converted text model with more than 300M parameters trains with LoRA unless you turn it off with training_plan.enable_lora(False). LoRA lowers the memory the training needs in the secure environment. It doesn’t raise the 705M limit: each round still averages the model’s full weights. With fedmedian, fedtrimmedavg or krum, which merge every secure environment’s weights at once, the limit depends instead on how many secure environments the experiment trains on: the refusal says how many of the model’s weights it can merge. Link the uploaded model to the use case’s dataset, then configure and start the experiment as for any model:
When the converted model’s classes or features don’t match the dataset, linking rebuilds it for the dataset and links it in one step. A converted model trains with its own sequence length and image normalisation. Set its batch size with training_plan.batch_size(n). For every training setting, see Hyperparameters and Start Training.