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
Question About

Question about https://allegro.ai/clearml/docs/rst/references/clearml_python_ref/task_module/task_task.html#clearml.task.Task.upload_artifact : Let's say I give it a folder, and I want it to upload the files in that folder, but not subfolders . How would I do that? So for example I have
` ./output/ # contains a pytorch_model.bin file and some other files
./output/checkpoint-500/ #contains a pytorch_model.bin file also, and some more other files
./output/checkpoint-1000/ #contains a pytorch_model.bin file also, and some more other files

and many more checkpoints And I want to upload the model from ./output/ , but NOT the model from ./output/checkpoint-500/ or ./output/checkpoint-1000/ `

  
  
Posted 2 years ago
Votes Newest

Answers 7


Yeah! So if given a folder, it adds everything in the folder. But if given a list or iterable, it iterates over the Paths and zips them all up.

  
  
Posted 2 years ago

That sounds about right to me 🙂

  
  
Posted 2 years ago

Well, I can just work around it now that I know, by creating a folder with no subfolders and uploading that. But... 🤔 perhaps allow the interface to take in a list or generator? As in,
files_to_upload = [f for f in output_dir.glob("*") if f.is_file()] Task.current_task().upload_artifact( "best_checkpoint", artifact_object=files_to_upload)And then it could zip up the list and name it "best_checkpoint"?

  
  
Posted 2 years ago

I know the documentation says that you can give it a wildcard or pathlib Path - but I'm still not quite sure exactly how to tell it "top-level files only, not subfolders".

  
  
Posted 2 years ago

This sort of behavior is what I was thinking about when I saw "wildcard or pathlib Path" listed as options

  
  
Posted 2 years ago

So basically a list of Path objects ?

  
  
Posted 2 years ago

Hi SmallDeer34
Hmm I'm not sure you can, the code will by default use rglob with the last part of the path as wildcard selection
😞
You can of course manually create a zip file...
How would you change the interface to support it ?

  
  
Posted 2 years ago
540 Views
7 Answers
2 years ago
one year ago
Tags
Similar posts