Skip to content

Commit

Permalink
Fix TypeError in samplers.py by converting int to str (EleutherAI#2074)
Browse files Browse the repository at this point in the history
Co-authored-by: yhjo <[email protected]>
  • Loading branch information
uni2237 and yhjo authored Jul 8, 2024
1 parent d855d0b commit 5a7ed3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lm_eval/api/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_context(self, doc, num_fewshot):
labeled_examples += (
str(doc_target[0])
if isinstance(doc_target, list)
else doc_target
else str(doc_target)
if self.config.doc_to_choice is None or isinstance(doc_target, str)
else str(self.doc_to_choice(doc)[doc_target])
)
Expand Down

0 comments on commit 5a7ed3e

Please sign in to comment.