feat(components): add a check for model garden models and skip eval import

PiperOrigin-RevId: 535431767
This commit is contained in:
Jason Dai 2023-05-25 16:44:16 -07:00 committed by Google Cloud Pipeline Components maintainers
parent 9e5e6c6250
commit 1782ee2d89
1 changed files with 4 additions and 1 deletions

View File

@ -18,7 +18,7 @@ import json
import logging
import os
import sys
from typing import Any, Dict, List, Optional, Tuple, Iterable
from typing import Any, Dict, Iterable, List, Optional, Tuple
from google.api_core import gapic_v1
from google.cloud import aiplatform
@ -135,6 +135,9 @@ def main(argv):
"""Calls ModelService.ImportModelEvaluation."""
parsed_args, _ = parser.parse_known_args(argv)
if parsed_args.model_name.startswith('publishers'):
return
_, project_id, _, location, _, model_id = parsed_args.model_name.split('/')
api_endpoint = location + '-aiplatform.googleapis.com'
resource_uri_prefix = f'https://{api_endpoint}/v1/'