File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 8
8
import sys
9
9
import os
10
10
from ads .aqua .utils import fetch_service_compartment
11
- from ads .config import OCI_RESOURCE_PRINCIPAL_VERSION
11
+ from ads .config import NB_SESSION_OCID , OCI_RESOURCE_PRINCIPAL_VERSION
12
12
from ads import set_auth
13
13
14
14
logger = logging .getLogger (__name__ )
22
22
if not ODSC_MODEL_COMPARTMENT_OCID :
23
23
try :
24
24
ODSC_MODEL_COMPARTMENT_OCID = fetch_service_compartment ()
25
- except Exception as e :
25
+ except :
26
+ pass
27
+
28
+ if not ODSC_MODEL_COMPARTMENT_OCID :
29
+ logger .error (
30
+ f"ODSC_MODEL_COMPARTMENT_OCID environment variable is not set for Aqua."
31
+ )
32
+ if NB_SESSION_OCID :
26
33
logger .error (
27
- f"ODSC_MODEL_COMPARTMENT_OCID environment variable is not set for Aqua, due to { e } ."
34
+ f"Aqua is not available for this notebook session { NB_SESSION_OCID } ."
28
35
)
36
+ exit ()
You can’t perform that action at this time.
0 commit comments