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 2 years ago
Votes Newest

Answers 2


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 2 years ago

Simpler than I had thought, thanks !

  
  
Posted 2 years ago
1K Views
2 Answers
2 years ago
one year ago
Tags