Skip to content

Commit a016e33

Browse files
check if file exists
1 parent f59b67f commit a016e33

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

ads/aqua/app.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from ads.aqua.constants import UNKNOWN
2424
from ads.common import oci_client as oc
2525
from ads.common.auth import default_signer
26-
from ads.common.utils import extract_region
26+
from ads.common.utils import extract_region, is_path_exists
2727
from ads.config import (
2828
AQUA_TELEMETRY_BUCKET,
2929
AQUA_TELEMETRY_BUCKET_NS,
@@ -317,17 +317,19 @@ def get_config(self, model_id: str, config_file_name: str) -> Dict:
317317
)
318318
return config
319319

320-
try:
321-
config = load_config(
322-
config_path,
323-
config_file_name=config_file_name,
324-
)
325-
except Exception:
326-
logger.debug(
327-
f"Error loading the {config_file_name} at path {config_path}.",
328-
exc_info=True,
329-
)
330-
pass
320+
config_file_path = f"{config_path}{config_file_name}"
321+
if is_path_exists(config_file_path):
322+
try:
323+
config = load_config(
324+
config_path,
325+
config_file_name=config_file_name,
326+
)
327+
except Exception:
328+
logger.debug(
329+
f"Error loading the {config_file_name} at path {config_path}.",
330+
exc_info=True,
331+
)
332+
pass
331333

332334
if not config:
333335
logger.error(

0 commit comments

Comments
 (0)