Skip to content

Commit

Permalink
fix: images will be lost when its path is a abspath (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijianma authored Jan 17, 2024
1 parent 2588004 commit 4b759db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data_juicer/format/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def rel2abs(sample, path_keys, dataset_dir):
if not paths:
continue
new_paths = [
os.path.join(dataset_dir, path) for path in paths
if not os.path.isabs(path)
path if os.path.isabs(path) else os.path.join(
dataset_dir, path) for path in paths
]
sample[path_key] = new_paths
return sample
Expand Down

0 comments on commit 4b759db

Please sign in to comment.