Beispiel #1
0
def load(archive_path):
    """Load bento service from local file path or s3 path

    Args:
        archive_path (str): The path that contains archived bento service.
            It could be local file path or aws s3 path

    Returns:
        bentoml.service.BentoService: The loaded bento service.
    """
    track_load_start()
    svc_cls = load_bento_service_class(archive_path)

    svc = svc_cls.load_from_dir(archive_path)
    track_load_finish(svc)
    return svc
Beispiel #2
0
def load_from_dir(bundle_path):
    """Load bento service from local file path or s3 path

    Args:
        bundle_path (str): The path that contains saved BentoService bundle,
            supporting both local file path and s3 path

    Returns:
        bentoml.service.BentoService: a loaded BentoService instance
    """
    track_load_start()

    svc_cls = load_bento_service_class(bundle_path)
    svc = svc_cls()

    track_load_finish(svc)
    return svc
Beispiel #3
0
def load(bundle_path):
    """Load bento service from local file path or s3 path

    Args:
        bundle_path (str): The path that contains saved BentoService bundle,
            supporting both local file path and s3 path

    Returns:
        bentoml.service.BentoService: a loaded BentoService instance
    """

    if _is_remote_path(bundle_path):
        with _resolve_remote_bundle_path(bundle_path) as local_bundle_path:
            return load(local_bundle_path)
    track_load_start()

    svc_cls = load_bento_service_class(bundle_path)
    svc = svc_cls()

    track_load_finish(svc)
    return svc