Skip to content

Commit

Permalink
Resolve path resolution (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchaton authored Mar 8, 2024
1 parent 97257f3 commit 6e6a629
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions litdata/processing/data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,12 @@ def _is_path(input_dir: Optional[str], element: Any) -> bool:

element = str(Path(element).absolute())
if element.startswith(input_dir):
return True
# check whether the element has an extension.
if os.path.splitext(element)[1]:
return True
return os.path.isfile(element)

return os.path.exists(element)
return os.path.isfile(element)


class BaseWorker:
Expand Down

0 comments on commit 6e6a629

Please sign in to comment.