Skip to content

Registering a model#

For each model that you're working with, you can register it in Neptune and track any related metadata.

The Model object is suitable for storing general metadata that is shared by all versions of the model – for example, the model signature and validation datasets.

  1. In the Models tab, click Create new model.
  2. Enter a key and optionally a name and description for your model.
  3. To log metadata to the model, initialize it in your code:

    import neptune.new as neptune
    
    model = neptune.init_model(
        model="CLS-PRE",  # Your model ID here
    )
    
    How do I find the ID?

    The Neptune ID is a unique identifier for the object. It's shown in the leftmost column of the table view.

    The ID is stored in the system namespace, in the "sys/id" field.

Import Neptune and initialize a Model object:

import neptune.new as neptune

model = neptune.init_model(
    name="A name for your model",  # optional
    key="MODEL_KEY",  # must be uppercase and unique within the project
)

To see the model in Neptune, navigate to the Models tab.

  • (Optional) You can also store any metadata you want:

    Track model metadata by assigning them to the model object:

    model_info = {"size_limit": 50.0, "size_units": "MB"}
    model["model"] = model_info
    

    Upload the model signature and other data with the upload() method:

    model["model/signature"].upload("model_signature.json")
    

    Track dataset versions with the track_files() method:

    model["data/train"].track_files("data/train.csv")
    model["data/validation/dataset/v0.1"].track_files("s3://datasets/validation")
    

    To stop the connection to Neptune and sync all data, call the stop() method and execute the script or cell:

    model.stop()
    

    To see the model in Neptune, click the link in the console output.

Next steps#

Back to top