File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
sign_language_datasets/datasets/dgs_corpus Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,16 @@ def load_split(split_name: str) -> Dict[str, str]:
109109 :return:
110110 """
111111 if split_name not in _KNOWN_SPLITS .keys ():
112- raise ValueError ("Split '%s' is not a known data split." % split_name )
112+ if not path .exists (split_name ):
113+ raise ValueError ("Split '%s' is not a known data split identifier and does not exist as a file either." % split_name )
113114
114- with open (_KNOWN_SPLITS [split_name ]) as infile :
115+ # assume that the supplied string is a path on the file system
116+ split_path = split_name
117+ else :
118+ # the supplied string is an identifier for a predefined split
119+ split_path = _KNOWN_SPLITS [split_name ]
120+
121+ with open (split_path ) as infile :
115122 split = json .load (infile ) # type: Dict[str, str]
116123
117124 return split
You can’t perform that action at this time.
0 commit comments