make linter happy

This commit is contained in:
teknium 2025-07-26 21:12:30 +00:00
parent a2e14cf50c
commit aa66b09c13

View file

@ -1,5 +1,4 @@
import asyncio import asyncio
import json
import math import math
import random import random
import re import re
@ -502,7 +501,7 @@ class PairwiseJudgementEnv(BaseEnv):
) )
# Show configuration info # Show configuration info
print(f"\nPairwise Judgement Configuration:") print("\nPairwise Judgement Configuration:")
print( print(
f" - Training dataset: {self.config.train_dataset} (split: {self.config.train_split})" f" - Training dataset: {self.config.train_dataset} (split: {self.config.train_split})"
) )
@ -517,7 +516,7 @@ class PairwiseJudgementEnv(BaseEnv):
if len(self.train) > 0: if len(self.train) > 0:
try: try:
sample_train_item = self.train[0] sample_train_item = self.train[0]
print(f"\nSample training item structure:") print("\nSample training item structure:")
print(f"- Available keys: {list(sample_train_item.keys())}") print(f"- Available keys: {list(sample_train_item.keys())}")
if "uid" in sample_train_item: if "uid" in sample_train_item:
@ -536,7 +535,7 @@ class PairwiseJudgementEnv(BaseEnv):
if len(self.test) > 0: if len(self.test) > 0:
try: try:
sample_eval_item = self.test[0] sample_eval_item = self.test[0]
print(f"\nSample evaluation item structure:") print("\nSample evaluation item structure:")
print(f"- Available keys: {list(sample_eval_item.keys())}") print(f"- Available keys: {list(sample_eval_item.keys())}")
# Handle different dataset structures # Handle different dataset structures
@ -839,7 +838,7 @@ class PairwiseJudgementEnv(BaseEnv):
else: else:
# Fallback if generation fails # Fallback if generation fails
answers = [ answers = [
"This is a comprehensive and well-structured response that addresses the question thoroughly with detailed examples and clear explanations.", "This is a comprehensive and well-structured response that addresses the question thoroughly with detailed examples and clear explanations.", # noqa
"Brief response.", "Brief response.",
] ]
# Pad to required number of choices # Pad to required number of choices
@ -851,7 +850,7 @@ class PairwiseJudgementEnv(BaseEnv):
answers = answers[: self.config.num_choices] answers = answers[: self.config.num_choices]
random.shuffle(answers) random.shuffle(answers)
correct_index = answers.index( correct_index = answers.index(
"This is a comprehensive and well-structured response that addresses the question thoroughly with detailed examples and clear explanations." "This is a comprehensive and well-structured response that addresses the question thoroughly with detailed examples and clear explanations." # noqa
) )
correct_answer = self.choice_letters[correct_index] correct_answer = self.choice_letters[correct_index]