Skip to content

Commit

Permalink
refactoring and small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Aug 14, 2023
1 parent 59e20ce commit a275674
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions eval/hf_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
from psycopg2.extensions import QueryCanceledError
from time import time
import gc

# from optimum.bettertransformer import BetterTransformer
# os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "max_split_size_mb:512"
import traceback


def prepare_questions_df(questions_file, num_questions):
Expand Down Expand Up @@ -141,22 +139,22 @@ def run_hf_eval(
columns=str.lower
)

exact_match = subset = int(
exact_match = correct = int(
compare_df(
expected_result, generated_result, query_category, question
)
)
if not exact_match:
subset = subset_df(
correct = subset_df(
df_sub=expected_result,
df_super=generated_result,
query_category=query_category,
question=question,
)
row["exact_match"] = int(correct)
row["correct"] = int(exact_match)
row["exact_match"] = int(exact_match)
row["correct"] = int(correct)
row["error_msg"] = ""
if subset:
if correct:
total_correct += 1
except QueryCanceledError as e:
row["timeout"] = 1
Expand Down

0 comments on commit a275674

Please sign in to comment.