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

fix: loading json file error in iter_from_json_file method #264

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions label_studio_converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ def iter_from_json_file(self, json_file):

# one task
if data_type == 'dict':
data = json.load(json_file)
for item in self.annotation_result_from_task(data):
yield item
with open(json_file, 'r') as json_file:
data = json.load(json_file)
for item in self.annotation_result_from_task(data):
yield item

# many tasks
elif data_type == 'list':
Expand Down
Loading