Skip to content

Commit ff67aff

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

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

eval_protocol/pytest/handle_persist_flow.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from eval_protocol.fireworks_api_client import FireworksAPIClient
1212
from eval_protocol.models import EvaluationRow
1313
from eval_protocol.pytest.store_experiment_link import store_experiment_link
14-
import requests
1514

1615

1716
def handle_persist_flow(all_results: list[list[EvaluationRow]], test_func_name: str):
@@ -128,8 +127,7 @@ def get_auth_value(key: str) -> str | None:
128127
)
129128
continue
130129

131-
client = FireworksAPIClient(api_key=fireworks_api_key,
132-
api_base="https://api.fireworks.ai")
130+
client = FireworksAPIClient(api_key=fireworks_api_key, api_base="https://api.fireworks.ai")
133131

134132
# Make dataset first
135133

@@ -143,7 +141,9 @@ def get_auth_value(key: str) -> str | None:
143141
"datasetId": dataset_name,
144142
}
145143

146-
dataset_response = requests.post(dataset_url, json=dataset_payload, headers=headers) # pyright: ignore[reportUnknownArgumentType]
144+
dataset_response = client.post(
145+
f"v1/accounts/{fireworks_account_id}/datasets", json=dataset_payload
146+
) # pyright: ignore[reportUnknownArgumentType]
147147

148148
# Skip if dataset creation failed
149149
if dataset_response.status_code not in [200, 201]:
@@ -160,8 +160,9 @@ def get_auth_value(key: str) -> str | None:
160160
# Upload the JSONL file content
161161
with open(exp_file, "rb") as f:
162162
files = {"file": f}
163-
upload_response = client.post(f"v1/accounts/{fireworks_account_id}/datasets/{dataset_id}:upload",
164-
files=files)
163+
upload_response = client.post(
164+
f"v1/accounts/{fireworks_account_id}/datasets/{dataset_id}:upload", files=files
165+
)
165166

166167
# Skip if upload failed
167168
if upload_response.status_code not in [200, 201]:
@@ -173,7 +174,6 @@ def get_auth_value(key: str) -> str | None:
173174
continue
174175

175176
# Create evaluation job (optional - don't skip experiment if this fails)
176-
eval_job_url = f"https://api.fireworks.ai/v1/accounts/{fireworks_account_id}/evaluationJobs"
177177
# Truncate job ID to fit 63 character limit
178178
job_id_base = f"{dataset_name}-job"
179179
if len(job_id_base) > 63:
@@ -191,8 +191,9 @@ def get_auth_value(key: str) -> str | None:
191191
},
192192
}
193193

194-
eval_response = client.post(f"v1/accounts/{fireworks_account_id}/evaluationJobs",
195-
json=eval_job_payload)
194+
eval_response = client.post(
195+
f"v1/accounts/{fireworks_account_id}/evaluationJobs", json=eval_job_payload
196+
)
196197

197198
if eval_response.status_code in [200, 201]:
198199
eval_job_data = eval_response.json() # pyright: ignore[reportAny]

0 commit comments

Comments
 (0)