diff --git a/examples/api_pipeline_run.py b/examples/api_pipeline_run.py index 6cfb5adb..31997f8e 100644 --- a/examples/api_pipeline_run.py +++ b/examples/api_pipeline_run.py @@ -3,7 +3,6 @@ from pipeline import Pipeline, PipelineCloud, Variable, pipeline_function api = PipelineCloud() -api.authenticate() @pipeline_function diff --git a/examples/huggingface/gpt-j-6b.py b/examples/huggingface/gpt-j-6b.py index 1a2fb63b..d3e842d1 100644 --- a/examples/huggingface/gpt-j-6b.py +++ b/examples/huggingface/gpt-j-6b.py @@ -131,7 +131,6 @@ def __exit__(self, type, value, traceback): api = PipelineCloud() -api.authenticate() with Pipeline("GPT-J-6B") as builder: input_str = Variable(str, is_input=True) diff --git a/examples/huggingface/gpt-neo-upload.py b/examples/huggingface/gpt-neo-upload.py index 26344ca0..5b05491b 100644 --- a/examples/huggingface/gpt-neo-upload.py +++ b/examples/huggingface/gpt-neo-upload.py @@ -44,7 +44,6 @@ def load(self) -> None: # load_dotenv("hidden.env") api = PipelineCloud() -api.authenticate() with Pipeline("HF pipeline") as builder: input_str = Variable(str, is_input=True) diff --git a/pipeline/schemas/run.py b/pipeline/schemas/run.py index 6c0344f9..5a787e14 100644 --- a/pipeline/schemas/run.py +++ b/pipeline/schemas/run.py @@ -33,12 +33,20 @@ class RunError(Enum): PIPELINE_FAULT = "pipeline_fault" +# https://github.com/samuelcolvin/pydantic/issues/2278 +class ComputeType(str, Enum): + cpu: str = "cpu" + gpu: str = "gpu" + + class RunCreate(BaseModel): pipeline_id: Optional[str] function_id: Optional[str] data: Optional[Any] data_id: Optional[str] blocking: Optional[bool] = False + # By default a Run will require GPU resources + compute_type: ComputeType = ComputeType.gpu @root_validator def pipeline_data_val(cls, values): @@ -74,6 +82,7 @@ class RunGet(BaseModel): started_at: Optional[datetime.datetime] ended_at: Optional[datetime.datetime] run_state: RunState + resource_type: Optional[str] compute_time_ms: Optional[int] runnable: Union[FunctionGet, PipelineGet] data: DataGet @@ -90,7 +99,6 @@ class Config: class RunGetDetailed(RunGet): runnable: Union[FunctionGetDetailed, PipelineGetDetailed] n_resources: int - resource_type: Optional[str] region: str tags: List[TagGet] = [] inputs: List[RunIOGet] = [] diff --git a/pyproject.toml b/pyproject.toml index 4658f5c9..df710260 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pipeline-ai" -version = "0.0.25" +version = "0.0.26" description = "Pipelines for machine learning workloads." authors = ["Paul Hetherington ", "Alex Pearwin ", "Maximiliano Schulkin ", "Neil Wang "] packages = [