Ayush Chaurasia
commited on
W&B: Fix dataset check (#4879)
Browse files* evolve fix
* Enable login timeout
* fix pkg
* check rank
* don't relogin
* fix
* reformat
utils/loggers/wandb/wandb_utils.py
CHANGED
@@ -5,8 +5,8 @@ import os
|
|
5 |
import sys
|
6 |
from contextlib import contextmanager
|
7 |
from pathlib import Path
|
8 |
-
import pkg_resources as pkg
|
9 |
|
|
|
10 |
import yaml
|
11 |
from tqdm import tqdm
|
12 |
|
@@ -49,9 +49,11 @@ def check_wandb_dataset(data_file):
|
|
49 |
if check_file(data_file) and data_file.endswith('.yaml'):
|
50 |
with open(data_file, errors='ignore') as f:
|
51 |
data_dict = yaml.safe_load(f)
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
55 |
return data_dict
|
56 |
else:
|
57 |
return check_dataset(data_file)
|
|
|
5 |
import sys
|
6 |
from contextlib import contextmanager
|
7 |
from pathlib import Path
|
|
|
8 |
|
9 |
+
import pkg_resources as pkg
|
10 |
import yaml
|
11 |
from tqdm import tqdm
|
12 |
|
|
|
49 |
if check_file(data_file) and data_file.endswith('.yaml'):
|
50 |
with open(data_file, errors='ignore') as f:
|
51 |
data_dict = yaml.safe_load(f)
|
52 |
+
is_trainset_wandb_artifact = (isinstance(data_dict['train'], str) and
|
53 |
+
data_dict['train'].startswith(WANDB_ARTIFACT_PREFIX))
|
54 |
+
is_valset_wandb_artifact = (isinstance(data_dict['val'], str) and
|
55 |
+
data_dict['val'].startswith(WANDB_ARTIFACT_PREFIX))
|
56 |
+
if is_trainset_wandb_artifact or is_valset_wandb_artifact:
|
57 |
return data_dict
|
58 |
else:
|
59 |
return check_dataset(data_file)
|