Skip to content

Commit

Permalink
remove unused comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyg committed Jul 12, 2024
1 parent 652e13c commit 67b7417
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions textgrad/tasks/multimodal/mathvista.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def extract_answer(response, problem, quick_extract=False):
except:
pass

# quick extraction
if quick_extract:
try:
result = re.search(r'The answer is "(.*)"\.', response)
Expand All @@ -134,7 +133,6 @@ def extract_answer(response, problem, quick_extract=False):
except Exception as e:
raise Exception(f"Error in extracting answer for {pid}: {e}. Remove this line responsibly.")

# general extraction
try:
from textgrad.engine.openai import ChatOpenAI
local_llm_engine = ChatOpenAI(model_string="gpt-3.5-turbo", is_multimodal=False)
Expand All @@ -153,7 +151,6 @@ def get_most_similar(prediction, choices):
distances = [distance(prediction, choice) for choice in choices]
ind = distances.index(min(distances))
return choices[ind]
# return min(choices, key=lambda choice: distance(prediction, choice))


def normalize_extracted_answer(extraction, question_data):
Expand Down Expand Up @@ -243,8 +240,6 @@ def __init__(self, evaluation_api:str, root: str=None, split: str="testmini", ta
def __getitem__(self, index):
row = self.data[index]
pid = row["pid"]
# question = row["question"]
# image = row["image"]
decoded_image = row["decoded_image"]
choices = row["choices"]
unit = row["unit"]
Expand Down

0 comments on commit 67b7417

Please sign in to comment.