diff --git a/examples/e2e_nlp/.copier-answers.yml b/examples/e2e_nlp/.copier-answers.yml index a94cc20cf38..a8fc9273fa5 100644 --- a/examples/e2e_nlp/.copier-answers.yml +++ b/examples/e2e_nlp/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 2024.06.14 +_commit: 2024.08.07 _src_path: gh:zenml-io/template-nlp accelerator: cpu cloud_of_choice: aws diff --git a/examples/e2e_nlp/gradio/requirements.txt b/examples/e2e_nlp/gradio/requirements.txt index 4ae46ad6354..1bddfdfb85b 100644 --- a/examples/e2e_nlp/gradio/requirements.txt +++ b/examples/e2e_nlp/gradio/requirements.txt @@ -7,6 +7,6 @@ datasets==2.12.0 numpy==1.22.4 pandas==1.5.3 session_info==1.0.0 -scikit-learn==1.2.2 +scikit-learn==1.5.0 transformers==4.28.1 IPython==7.34.0 \ No newline at end of file diff --git a/examples/e2e_nlp/requirements.txt b/examples/e2e_nlp/requirements.txt index ee4e7af4f42..f7f98175b16 100644 --- a/examples/e2e_nlp/requirements.txt +++ b/examples/e2e_nlp/requirements.txt @@ -1,4 +1,4 @@ torchvision accelerate gradio -zenml[server]==0.56.3 +zenml[server]>=0.56.3 diff --git a/src/zenml/enums.py b/src/zenml/enums.py index 79636392e79..1ff4e8fb46b 100644 --- a/src/zenml/enums.py +++ b/src/zenml/enums.py @@ -302,6 +302,7 @@ class EnvironmentType(StrEnum): NOTEBOOK = "notebook" PAPERSPACE = "paperspace" WSL = "wsl" + LIGHTNING_AI_STUDIO = "lightning_ai_studio" class ModelStages(StrEnum): diff --git a/src/zenml/environment.py b/src/zenml/environment.py index ac80bbf9be9..f25c2c641d8 100644 --- a/src/zenml/environment.py +++ b/src/zenml/environment.py @@ -70,6 +70,8 @@ def get_environment() -> str: return EnvironmentType.BITBUCKET_CI elif Environment.in_ci(): return EnvironmentType.GENERIC_CI + elif Environment.in_lightning_ai_studio(): + return EnvironmentType.LIGHTNING_AI_STUDIO elif Environment.in_docker(): return EnvironmentType.DOCKER elif Environment.in_container(): @@ -339,6 +341,19 @@ def in_wsl() -> bool: """ return "microsoft-standard" in platform.uname().release + @staticmethod + def in_lightning_ai_studio() -> bool: + """If the current Python process is running in Lightning.ai studios. + + Returns: + `True` if the current Python process is running in Lightning.ai studios, + `False` otherwise. + """ + return ( + "LIGHTNING_CLOUD_URL" in os.environ + and "LIGHTNING_CLOUDSPACE_HOST" in os.environ + ) + def register_component( self, component: "BaseEnvironmentComponent" ) -> "BaseEnvironmentComponent":