Skip to content

Commit 6e6a629

Browse files
authored
Resolve path resolution (#68)
1 parent 97257f3 commit 6e6a629

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

litdata/processing/data_processor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,12 @@ def _is_path(input_dir: Optional[str], element: Any) -> bool:
349349

350350
element = str(Path(element).absolute())
351351
if element.startswith(input_dir):
352-
return True
352+
# check whether the element has an extension.
353+
if os.path.splitext(element)[1]:
354+
return True
355+
return os.path.isfile(element)
353356

354-
return os.path.exists(element)
357+
return os.path.isfile(element)
355358

356359

357360
class BaseWorker:

0 commit comments

Comments
 (0)