Skip to content

Commit

Permalink
Update roboflow/util/folderparser.py
Browse files Browse the repository at this point in the history
Co-authored-by: Iuri de Silvio <[email protected]>
  • Loading branch information
tonylampada and iurisilvio committed Sep 16, 2024
1 parent 7572e67 commit ffe9afd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions roboflow/util/folderparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,14 @@ def _loadAnnotations(folder, annotations):
def _read_jsonl(path):
data = []
with open(path) as file:
for line in file:
for linenum, line in enumerate(file, 1):
if not line:
continue
try:
json_object = json.loads(line.strip())
data.append(json_object)
except json.JSONDecodeError:
print(f"Warning: Skipping invalid JSON line in {path}")
print(f"Warning: Skipping invalid JSON line in {path}:{linenum}")
return data


Expand Down

0 comments on commit ffe9afd

Please sign in to comment.