Ayush Chaurasia
commited on
Explicitly convert artifact path to posix_path (#3067)
Browse files* Explicitly convert artifact path to posix_path
* Remove redudant str() casting
utils/wandb_logging/wandb_utils.py
CHANGED
@@ -158,7 +158,8 @@ class WandbLogger():
|
|
158 |
|
159 |
def download_dataset_artifact(self, path, alias):
|
160 |
if isinstance(path, str) and path.startswith(WANDB_ARTIFACT_PREFIX):
|
161 |
-
|
|
|
162 |
assert dataset_artifact is not None, "'Error: W&B dataset artifact doesn\'t exist'"
|
163 |
datadir = dataset_artifact.download()
|
164 |
return datadir, dataset_artifact
|
|
|
158 |
|
159 |
def download_dataset_artifact(self, path, alias):
|
160 |
if isinstance(path, str) and path.startswith(WANDB_ARTIFACT_PREFIX):
|
161 |
+
artifact_path = Path(remove_prefix(path, WANDB_ARTIFACT_PREFIX) + ":" + alias)
|
162 |
+
dataset_artifact = wandb.use_artifact(artifact_path.as_posix())
|
163 |
assert dataset_artifact is not None, "'Error: W&B dataset artifact doesn\'t exist'"
|
164 |
datadir = dataset_artifact.download()
|
165 |
return datadir, dataset_artifact
|