Skip to content

Commit cbd572a

Browse files
Update docs/quickstarts/pytorch.mdx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 4e486c4 commit cbd572a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/quickstarts/pytorch.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ def obj_to_tensor(obj):
182182
# (Optional) derive label from the S3 key if applicable
183183
key_path = obj.key # e.g. "train/images/7/img123.png"
184184
# Assuming the directory name is the label (e.g. "7" for class 7):
185-
label_str = key_path.split("/")[1] # "7" in this example
186-
label = int(label_str) if label_str.isdigit() else label_str
185+
# Assuming the directory name is the label (e.g. "7" for class 7):
186+
label_str = key_path.split("/")[2] # "7" in this example
187187
return tensor, label
188188
```
189189

0 commit comments

Comments
 (0)