Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
I Have A Training Task That Auto-Magically Saves A Model For Me To Gcs

I have a training task that auto-magically saves a model for me to GCS

task = Task.init( project_name=project_name, task_name=f"Image classification training", output_uri = "gs://" + bucket_name ) ... PATH = "./classifier_net.pth" torch.save(net.state_dict(), PATH) # auto-uploads to GCS
Now I'd like to https://clear.ml/docs/latest/docs/references/sdk/model_model#set_metadata to the model.
I've not seen any examples of how it's done. Do I need to forgo auto-magic
and create an OutputModel?

Sample code example would be nice 🙏

  
  
Posted one year ago
Votes Newest

Answers 2


Simpler than I had thought, thanks !

  
  
Posted one year ago

Hi PanickyMoth78
` torch.save(net.state_dict(), PATH) # auto-uploads to GCS

get all the models from the Task

output_models = Task.current_task().models["output"]

get the last one

last_model = output_models[-1]

set meta-data

last_model.set_metadata(key="my key", value="my value", type="str") `

  
  
Posted one year ago
692 Views
2 Answers
one year ago
one year ago
Tags