File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
ads/opctl/operator/lowcode/forecast/model Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 2
2
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
3
3
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4
4
import logging
5
+ import os
5
6
import traceback
6
7
7
8
import numpy as np
@@ -80,10 +81,17 @@ def _build_model(self) -> pd.DataFrame:
80
81
81
82
from automlx import Pipeline , init
82
83
84
+ cpu_count = os .cpu_count ()
83
85
try :
86
+ if cpu_count < 4 :
87
+ engine = "local"
88
+ engine_opts = None
89
+ else :
90
+ engine = "ray"
91
+ engine_opts = ({"ray_setup" : {"_temp_dir" : "/tmp/ray-temp" }},)
84
92
init (
85
- engine = "ray" ,
86
- engine_opts = { "ray_setup" : { "_temp_dir" : "/tmp/ray-temp" }} ,
93
+ engine = engine ,
94
+ engine_opts = engine_opts ,
87
95
loglevel = logging .CRITICAL ,
88
96
)
89
97
except Exception as e :
You can’t perform that action at this time.
0 commit comments