Skip to content

Commit 0ba3df5

Browse files
author
Dylan Huang
committed
fix lint errors
1 parent d406ce0 commit 0ba3df5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

eval_protocol/evaluation.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def preview(self, sample_file, max_samples=5):
404404

405405
client = FireworksAPIClient(api_key=auth_token, api_base=api_base)
406406
path = f"v1/accounts/{account_id}/evaluators:previewEvaluator"
407-
407+
408408
logger.info(f"Previewing evaluator using API endpoint: {api_base}/{path} with account: {account_id}")
409409
logger.debug(f"Preview API Request Payload: {json.dumps(payload, indent=2)}")
410410

@@ -750,16 +750,16 @@ def create(self, evaluator_id, display_name=None, description=None, force=False)
750750

751751
try:
752752
if force:
753-
check_url = f"{self.api_base}/v1/{parent}/evaluators/{evaluator_id}"
753+
check_path = f"v1/{parent}/evaluators/{evaluator_id}"
754754
try:
755-
logger.info(f"Checking if evaluator exists: {check_url}")
756-
check_response = requests.get(check_url, headers=headers)
755+
logger.info(f"Checking if evaluator exists: {self.api_base}/{check_path}")
756+
check_response = client.get(check_path)
757757

758758
if check_response.status_code == 200:
759759
logger.info(f"Evaluator '{evaluator_id}' already exists, deleting and recreating...")
760-
delete_url = f"{self.api_base}/v1/{parent}/evaluators/{evaluator_id}"
760+
delete_path = f"v1/{parent}/evaluators/{evaluator_id}"
761761
try:
762-
delete_response = requests.delete(delete_url, headers=headers)
762+
delete_response = client.delete(delete_path)
763763
if delete_response.status_code < 400:
764764
logger.info(f"Successfully deleted evaluator '{evaluator_id}'")
765765
else:
@@ -768,14 +768,14 @@ def create(self, evaluator_id, display_name=None, description=None, force=False)
768768
)
769769
except Exception as e_del:
770770
logger.warning(f"Error deleting evaluator: {str(e_del)}")
771-
response = requests.post(base_url, json=payload_data, headers=headers)
771+
response = client.post(path, json=payload_data)
772772
else:
773-
response = requests.post(base_url, json=payload_data, headers=headers)
773+
response = client.post(path, json=payload_data)
774774
except requests.exceptions.RequestException:
775-
response = requests.post(base_url, json=payload_data, headers=headers)
775+
response = client.post(path, json=payload_data)
776776
else:
777-
logger.info(f"Creating evaluator at: {base_url}")
778-
response = requests.post(base_url, json=payload_data, headers=headers)
777+
logger.info(f"Creating evaluator at: {self.api_base}/{path}")
778+
response = client.post(path, json=payload_data)
779779

780780
response.raise_for_status()
781781
result = response.json()

0 commit comments

Comments
 (0)