Download minigpt2/lib/python3.10/site-packages/ray/workflow/exceptions.py from ZTWHHH/envs_2: direct link, hf CLI and curl.
- Browser
- Download file 1.94 kB
-
https://huggingface.co/datasets/ZTWHHH/envs_2/resolve/main/minigpt2/lib/python3.10/site-packages/ray/workflow/exceptions.py
- Command line
-
hf download hf://datasets/ZTWHHH/envs_2/minigpt2/lib/python3.10/site-packages/ray/workflow/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/datasets/ZTWHHH/envs_2/resolve/main/minigpt2/lib/python3.10/site-packages/ray/workflow/exceptions.py
1.94 kB
| from ray.util.annotations import PublicAPI | |
| from ray.workflow.common import TaskID | |
| class WorkflowError(Exception): | |
| """Workflow error base class.""" | |
| class WorkflowExecutionError(WorkflowError): | |
| def __init__(self, workflow_id: str): | |
| self.message = f"Workflow[id={workflow_id}] failed during execution." | |
| super().__init__(self.message) | |
| class WorkflowCancellationError(WorkflowError): | |
| def __init__(self, workflow_id: str): | |
| self.message = f"Workflow[id={workflow_id}] is cancelled during execution." | |
| super().__init__(self.message) | |
| class WorkflowNotResumableError(WorkflowError): | |
| """Raise the exception when we cannot resume from a workflow.""" | |
| def __init__(self, workflow_id: str): | |
| self.message = f"Workflow[id={workflow_id}] is not resumable." | |
| super().__init__(self.message) | |
| class WorkflowTaskNotRecoverableError(WorkflowNotResumableError): | |
| """Raise the exception when we find a workflow task cannot be recovered | |
| using the checkpointed inputs.""" | |
| def __init__(self, task_id: TaskID): | |
| self.message = f"Workflow task[id={task_id}] is not recoverable" | |
| super(WorkflowError, self).__init__(self.message) | |
| class WorkflowNotFoundError(WorkflowError): | |
| def __init__(self, workflow_id: str): | |
| self.message = f"Workflow[id={workflow_id}] was referenced but doesn't exist." | |
| super().__init__(self.message) | |
| class WorkflowStillActiveError(WorkflowError): | |
| def __init__(self, operation: str, workflow_id: str): | |
| self.message = ( | |
| f"{operation} couldn't be completed because " | |
| f"Workflow[id={workflow_id}] is still running or pending." | |
| ) | |
| super().__init__(self.message) | |