Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #79 from HumanSignal/fb-local-file-bugfix
Browse files Browse the repository at this point in the history
Fix bug when local file from LS is not found
  • Loading branch information
niklub authored Jun 4, 2024
2 parents 4564303 + 4200c1b commit 88b570d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions label_studio_tools/core/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ def get_local_path(
filepath = os.path.join(image_dir, project_id, os.path.basename(url))
if cache_dir and download_resources:
shutil.copy(filepath, cache_dir)
logger.debug(f"Uploaded file: Path exists in image_dir: {filepath}")
return filepath
if os.path.exists(filepath):
logger.debug(f"Uploaded file: Path exists in image_dir: {filepath}")
return filepath

# Upload or Local Storage file
if is_uploaded_file or is_local_storage_file or is_cloud_storage_file:
Expand Down

0 comments on commit 88b570d

Please sign in to comment.