mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-29 08:27:43 +00:00
force use_chat_cache False when facing error in evaluators (#432)
This commit is contained in:
@@ -190,7 +190,8 @@ class FactorOutputFormatEvaluator(FactorEvaluator):
|
||||
|
||||
while attempts < max_attempts:
|
||||
try:
|
||||
resp = APIBackend().build_messages_and_create_chat_completion(
|
||||
api = APIBackend() if attempts == 0 else APIBackend(use_chat_cache=False)
|
||||
resp = api.build_messages_and_create_chat_completion(
|
||||
user_prompt=gen_df_info_str, system_prompt=system_prompt, json_mode=True
|
||||
)
|
||||
resp_dict = json.loads(resp)
|
||||
@@ -535,8 +536,9 @@ class FactorFinalDecisionEvaluator(Evaluator):
|
||||
|
||||
while attempts < max_attempts:
|
||||
try:
|
||||
api = APIBackend() if attempts == 0 else APIBackend(use_chat_cache=False)
|
||||
final_evaluation_dict = json.loads(
|
||||
APIBackend().build_messages_and_create_chat_completion(
|
||||
api.build_messages_and_create_chat_completion(
|
||||
user_prompt=user_prompt,
|
||||
system_prompt=system_prompt,
|
||||
json_mode=True,
|
||||
|
||||
@@ -55,7 +55,7 @@ class FactorTestCaseLoaderFromJsonFile:
|
||||
factor_formulation=factor_data["formulation"],
|
||||
variables=factor_data["variables"],
|
||||
)
|
||||
gt = FactorFBWorkspace(task, raise_exception=True)
|
||||
gt = FactorFBWorkspace(task, raise_exception=False)
|
||||
code = {"factor.py": factor_data["gt_code"]}
|
||||
gt.inject_code(**code)
|
||||
test_cases.test_case_l.append(TestCase(task, gt))
|
||||
|
||||
Reference in New Issue
Block a user