Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pufanyi committed Mar 30, 2024
1 parent 8d56856 commit b677bf3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lmms_eval/api/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def __init__(self, task, few_shot_delimiter: str = "\n\n", target_delimiter: str

self.contexts = []

def get_question(self, doc, model_specific_prompt_kwargs=None):
text = self.doc_to_text(doc, model_specific_prompt_kwargs)
def get_question(self, doc):
text = self.doc_to_text(doc)
return text if (self.doc_to_choice is None or isinstance(text, str)) else self.doc_to_choice(doc)[text]

def get_target(self, doc):
Expand All @@ -37,8 +37,8 @@ def get_target(self, doc):
else self.doc_to_target(doc) if (self.config.doc_to_choice is None or type(self.doc_to_target(doc)) is str) else str(self.doc_to_choice(doc)[self.doc_to_target(doc)])
)

def add_in_context_example(self, doc, model_specific_prompt_kwargs=None, data_frame=None, index=None):
question = self.get_question(doc, model_specific_prompt_kwargs)
def add_in_context_example(self, doc, data_frame=None, index=None):
question = self.get_question(doc)
if data_frame and index:
visual = LazyLoadedImages(data_frame, index)
else:
Expand All @@ -51,8 +51,8 @@ def add_in_context_example(self, doc, model_specific_prompt_kwargs=None, data_fr
self.contexts.append(target)
self.contexts.append(self.few_shot_delimiter)

def add_question(self, doc, model_specific_prompt_kwargs=None, data_frame=None, index=None):
question = self.doc_to_text(doc, model_specific_prompt_kwargs)
def add_question(self, doc, data_frame=None, index=None):
question = self.get_question(doc)
if data_frame and index:
visual = LazyLoadedImages(data_frame, index)
else:
Expand Down

0 comments on commit b677bf3

Please sign in to comment.