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 thetraining extra, on Python 3.11, 3.12 or 3.13:
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 asdataset_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:
esm2_t6_8M is a Hugging Face folder. The SDK:
- Recognises the model, reads its licence and asks you to confirm it.
- 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 reporttracebloc_conversion.json. - Runs the acceptance check on the converted model.
- Uploads the converted model, and prints
Licence: MIT (from README.md license); confirmed by …and that the upload was successful.
Confirm the licence
The SDK reads the model’s licence from its model card or licence file and, in a notebook, asks: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:
licence_confirmed=True.
Weights whose licence forbids redistributing them, such as CC-BY-ND or CC-BY-NC-ND, are stopped before anything uploads:
Your own code
Pointupload_model at the folder with your model’s Python files, and its checkpoint if it has one:
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:
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.
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:
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 and train
Link the uploaded model to the use case’s dataset, then configure and start the experiment as for any model:training_plan.batch_size(n).
For every training setting, see Hyperparameters and Start Training.