edsl 0.1.51__py3-none-any.whl → 0.1.52__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- edsl/__init__.py +45 -34
- edsl/__version__.py +1 -1
- edsl/conversation/Conversation.py +2 -1
- edsl/coop/coop.py +2 -0
- edsl/interviews/answering_function.py +20 -21
- edsl/interviews/exception_tracking.py +4 -3
- edsl/interviews/interview_task_manager.py +5 -2
- edsl/invigilators/invigilators.py +32 -4
- edsl/jobs/html_table_job_logger.py +494 -257
- edsl/jobs/jobs_status_enums.py +1 -0
- edsl/jobs/remote_inference.py +46 -12
- edsl/language_models/language_model.py +148 -146
- edsl/results/results.py +31 -2
- edsl/tasks/task_history.py +45 -8
- edsl/templates/error_reporting/base.html +37 -4
- edsl/templates/error_reporting/exceptions_table.html +105 -33
- edsl/templates/error_reporting/interview_details.html +130 -126
- edsl/templates/error_reporting/overview.html +21 -25
- edsl/templates/error_reporting/report.css +215 -46
- edsl/templates/error_reporting/report.js +122 -20
- {edsl-0.1.51.dist-info → edsl-0.1.52.dist-info}/METADATA +1 -1
- {edsl-0.1.51.dist-info → edsl-0.1.52.dist-info}/RECORD +25 -25
- {edsl-0.1.51.dist-info → edsl-0.1.52.dist-info}/LICENSE +0 -0
- {edsl-0.1.51.dist-info → edsl-0.1.52.dist-info}/WHEEL +0 -0
- {edsl-0.1.51.dist-info → edsl-0.1.52.dist-info}/entry_points.txt +0 -0
edsl/jobs/jobs_status_enums.py
CHANGED
edsl/jobs/remote_inference.py
CHANGED
@@ -113,7 +113,7 @@ class JobsRemoteInferenceHandler:
|
|
113
113
|
logger.add_info("job_uuid", job_uuid)
|
114
114
|
|
115
115
|
logger.update(
|
116
|
-
f"Job details are available at your Coop account {self.remote_inference_url}",
|
116
|
+
f"Job details are available at your Coop account. [Go to Remote Inference page]({self.remote_inference_url})",
|
117
117
|
status=JobsStatus.RUNNING,
|
118
118
|
)
|
119
119
|
progress_bar_url = (
|
@@ -121,7 +121,7 @@ class JobsRemoteInferenceHandler:
|
|
121
121
|
)
|
122
122
|
logger.add_info("progress_bar_url", progress_bar_url)
|
123
123
|
logger.update(
|
124
|
-
f"View job progress here
|
124
|
+
f"View job progress [here]({progress_bar_url})", status=JobsStatus.RUNNING
|
125
125
|
)
|
126
126
|
|
127
127
|
return RemoteJobInfo(
|
@@ -169,7 +169,7 @@ class JobsRemoteInferenceHandler:
|
|
169
169
|
message="Job cancelled by the user.", status=JobsStatus.CANCELLED
|
170
170
|
)
|
171
171
|
job_info.logger.update(
|
172
|
-
f"See {self.expected_parrot_url}/home/remote-inference for more details.",
|
172
|
+
f"See [Remote Inference page]({self.expected_parrot_url}/home/remote-inference) for more details.",
|
173
173
|
status=JobsStatus.CANCELLED,
|
174
174
|
)
|
175
175
|
|
@@ -182,22 +182,45 @@ class JobsRemoteInferenceHandler:
|
|
182
182
|
reason = remote_job_data.get("reason")
|
183
183
|
|
184
184
|
if reason == "insufficient funds":
|
185
|
-
|
186
|
-
|
185
|
+
job_info.logger.update(
|
186
|
+
f"Error: Insufficient balance to start the job. Add funds to your account at the [Credits page]({self.expected_parrot_url}/home/credits)",
|
187
|
+
status=JobsStatus.FAILED,
|
188
|
+
)
|
187
189
|
|
188
190
|
if latest_error_report_url:
|
189
191
|
job_info.logger.add_info("error_report_url", latest_error_report_url)
|
190
192
|
|
191
193
|
job_info.logger.update("Job failed.", status=JobsStatus.FAILED)
|
192
194
|
job_info.logger.update(
|
193
|
-
f"See {self.expected_parrot_url}/home/remote-inference for more details.",
|
195
|
+
f"See [Remote Inference page]({self.expected_parrot_url}/home/remote-inference) for more details.",
|
194
196
|
status=JobsStatus.FAILED,
|
195
197
|
)
|
196
198
|
job_info.logger.update(
|
197
|
-
f"Need support? Visit Discord
|
199
|
+
f"Need support? [Visit Discord]({RemoteJobConstants.DISCORD_URL})",
|
198
200
|
status=JobsStatus.FAILED,
|
199
201
|
)
|
200
202
|
|
203
|
+
def _handle_partially_failed_job(
|
204
|
+
self, job_info: RemoteJobInfo, remote_job_data: RemoteInferenceResponse
|
205
|
+
) -> None:
|
206
|
+
"Handles a partially failed job by logging the error and updating the job status."
|
207
|
+
latest_error_report_url = remote_job_data.get("latest_error_report_url")
|
208
|
+
|
209
|
+
if latest_error_report_url:
|
210
|
+
job_info.logger.add_info("error_report_url", latest_error_report_url)
|
211
|
+
|
212
|
+
job_info.logger.update(
|
213
|
+
"Job completed with partial results.", status=JobsStatus.PARTIALLY_FAILED
|
214
|
+
)
|
215
|
+
job_info.logger.update(
|
216
|
+
f"See [Remote Inference page]({self.expected_parrot_url}/home/remote-inference) for more details.",
|
217
|
+
status=JobsStatus.PARTIALLY_FAILED,
|
218
|
+
)
|
219
|
+
job_info.logger.update(
|
220
|
+
f"Need support? [Visit Discord]({RemoteJobConstants.DISCORD_URL})",
|
221
|
+
status=JobsStatus.PARTIALLY_FAILED,
|
222
|
+
)
|
223
|
+
|
201
224
|
def _sleep_for_a_bit(self, job_info: RemoteJobInfo, status: str) -> None:
|
202
225
|
import time
|
203
226
|
from datetime import datetime
|
@@ -212,6 +235,7 @@ class JobsRemoteInferenceHandler:
|
|
212
235
|
def _fetch_results_and_log(
|
213
236
|
self,
|
214
237
|
job_info: RemoteJobInfo,
|
238
|
+
job_status: Literal["failed", "partial_failed", "completed"],
|
215
239
|
results_uuid: str,
|
216
240
|
remote_job_data: RemoteInferenceResponse,
|
217
241
|
object_fetcher: Callable,
|
@@ -221,10 +245,17 @@ class JobsRemoteInferenceHandler:
|
|
221
245
|
results = object_fetcher(results_uuid, expected_object_type="results")
|
222
246
|
results_url = remote_job_data.get("results_url")
|
223
247
|
job_info.logger.add_info("results_url", results_url)
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
248
|
+
|
249
|
+
if job_status == "completed":
|
250
|
+
job_info.logger.update(
|
251
|
+
f"Job completed and Results stored on Coop. [View Results]({results_url})",
|
252
|
+
status=JobsStatus.COMPLETED,
|
253
|
+
)
|
254
|
+
elif job_status == "partial_failed":
|
255
|
+
job_info.logger.update(
|
256
|
+
f"View partial results [here]({results_url})",
|
257
|
+
status=JobsStatus.PARTIALLY_FAILED,
|
258
|
+
)
|
228
259
|
results.job_uuid = job_info.job_uuid
|
229
260
|
results.results_uuid = results_uuid
|
230
261
|
return results
|
@@ -244,13 +275,16 @@ class JobsRemoteInferenceHandler:
|
|
244
275
|
return None, reason
|
245
276
|
|
246
277
|
elif status == "failed" or status == "completed" or status == "partial_failed":
|
247
|
-
if status == "failed"
|
278
|
+
if status == "failed":
|
248
279
|
self._handle_failed_job(job_info, remote_job_data)
|
280
|
+
elif status == "partial_failed":
|
281
|
+
self._handle_partially_failed_job(job_info, remote_job_data)
|
249
282
|
|
250
283
|
results_uuid = remote_job_data.get("results_uuid")
|
251
284
|
if results_uuid:
|
252
285
|
results = self._fetch_results_and_log(
|
253
286
|
job_info=job_info,
|
287
|
+
job_status=status,
|
254
288
|
results_uuid=results_uuid,
|
255
289
|
remote_job_data=remote_job_data,
|
256
290
|
object_fetcher=object_fetcher,
|