Skip to content

Commit

Permalink
deal with content management policy None
Browse files Browse the repository at this point in the history
  • Loading branch information
csinva committed Feb 13, 2025
1 parent 353c79c commit a47faf5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion imodelsx/qaemb/qaemb.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ def __call__(self, examples: List[str], verbose=True, debug_answering_correctly=
for i in range(min(30, len(programs))):
print(programs[i], '->', answers[i], end='\n\n\n')

answers = list(map(lambda x: 'yes' in x.lower(), answers))
def _check_for_yes(s):
if isinstance(s, str):
return 'yes' in s.lower()
else:
return False
answers = list(map(_check_for_yes, answers))
answers = np.array(answers).reshape(len(examples), len(self.questions))
embeddings = np.array(answers, dtype=float)

Expand Down

0 comments on commit a47faf5

Please sign in to comment.