Skip to content

Commit

Permalink
Merge pull request #152 from microsoft/fix_outout_bug
Browse files Browse the repository at this point in the history
fix output bug for evaluator
  • Loading branch information
sordonia authored Jan 6, 2025
2 parents 4c9b981 + f7adda8 commit a561f27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mttl/evaluators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class JsonCustomEncoder(json.JSONEncoder):
"""<cropped for brevity>"""

def default(self, obj):
if isinstance(obj, (np.ndarray, np.number)):
if isinstance(obj, (np.ndarray, np.number, torch.Tensor)):
return obj.tolist()
elif isinstance(obj, set):
return list(obj)
Expand Down

0 comments on commit a561f27

Please sign in to comment.