Skip to content

Commit

Permalink
Move serialization outside autolabel (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvaBansal00 authored Nov 1, 2024
1 parent fca9d03 commit 3561097
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/autolabel/tasks/attribute_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def parse_llm_response(
llm_label = {}
for k, v in json5.loads(completion_text).items():
if isinstance(v, list) or isinstance(v, dict):
llm_label[k] = json.dumps(v)
llm_label[k] = v
else:
llm_label[k] = str(v)
successfully_labeled = True
Expand All @@ -327,7 +327,7 @@ def parse_llm_response(
response.text[json_start : json_end + 1]
).items():
if isinstance(v, list) or isinstance(v, dict):
llm_label[k] = json.dumps(v)
llm_label[k] = v
else:
llm_label[k] = str(v)
successfully_labeled = True
Expand Down

0 comments on commit 3561097

Please sign in to comment.