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 88import sys
99import os
1010from 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
1212from ads import set_auth
1313
1414logger = logging .getLogger (__name__ )
2222if not ODSC_MODEL_COMPARTMENT_OCID :
2323 try :
2424 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 :
2633 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 } ."
2835 )
36+ exit ()
You can’t perform that action at this time.
0 commit comments