Skip to content

Commit 1b2745a

Browse files
committed
automlx version upgrade fixes
1 parent af032a3 commit 1b2745a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ads/opctl/operator/lowcode/anomaly/model/automlx.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ class AutoMLXOperatorModel(AnomalyOperatorBaseModel):
2626
)
2727
def _build_model(self) -> pd.DataFrame:
2828
from automlx import init
29-
init(engine="ray", engine_opts={"ray_setup": {"_temp_dir": "/tmp/ray-temp"}})
29+
try:
30+
init(engine="ray", engine_opts={"ray_setup": {"_temp_dir": "/tmp/ray-temp"}})
31+
except Exception as e:
32+
logger.info("Ray already initialized")
3033
date_column = self.spec.datetime_column.name
3134
anomaly_output = AnomalyOutput(date_column=date_column)
3235

ads/opctl/operator/lowcode/forecast/model/automlx.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ def preprocess(self, data, series_id=None):
7171
def _build_model(self) -> pd.DataFrame:
7272
from automlx import init
7373
from sktime.forecasting.model_selection import temporal_train_test_split
74+
try:
75+
init(engine="ray", engine_opts={"ray_setup": {"_temp_dir": "/tmp/ray-temp"}})
76+
except Exception as e:
77+
logger.info("Ray already initialized")
7478

75-
init(engine="ray", engine_opts={"ray_setup": {"_temp_dir": "/tmp/ray-temp"}})
7679

7780
full_data_dict = self.datasets.get_data_by_series()
7881

0 commit comments

Comments
 (0)