From 55eb697b6aa4349d9da0dec7fcad4bf78a9f1068 Mon Sep 17 00:00:00 2001 From: markstur Date: Tue, 12 Dec 2023 17:39:27 -0800 Subject: [PATCH] Update to work with caikit 0.25.x Signed-off-by: markstur --- caikit_huggingface_demo/app.py | 6 ++---- caikit_huggingface_demo/client/app.py | 4 ++-- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/caikit_huggingface_demo/app.py b/caikit_huggingface_demo/app.py index dbda740..8082703 100755 --- a/caikit_huggingface_demo/app.py +++ b/caikit_huggingface_demo/app.py @@ -53,7 +53,7 @@ def _get_module_models(model_manager=None) -> dict: """ if model_manager: model_modules = { - k: v.module().metadata["module_id"] + k: v.model().MODULE_ID for (k, v) in model_manager.loaded_models.items() } else: @@ -146,9 +146,7 @@ def main() -> int: if backend: print("▶️ Starting the backend Caikit inference server...") - with RuntimeGRPCServer( - inference_service=inference_service, training_service=None - ) as backend: + with RuntimeGRPCServer() as backend: if frontend: start_frontend(backend, inference_service) # and wait for termination else: diff --git a/caikit_huggingface_demo/client/app.py b/caikit_huggingface_demo/client/app.py index c1804b5..f1f2dc9 100644 --- a/caikit_huggingface_demo/client/app.py +++ b/caikit_huggingface_demo/client/app.py @@ -67,8 +67,8 @@ def get_frontend( reflection_db = ProtoReflectionDescriptorDatabase(channel) desc_pool = DescriptorPool(reflection_db) services = [ - x for x in reflection_db.get_services() if x.startswith("caikit.runtime.") - ] + x for x in reflection_db.get_services() if x.startswith("caikit.runtime.") and not ( + x.startswith("caikit.runtime.training") or x.startswith("caikit.runtime.training"))] if len(services) != 1: print(f"Error: Expected 1 caikit.runtime service, but found {len(services)}.") service_name = services[0] diff --git a/requirements.txt b/requirements.txt index ca86aae..10352eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -caikit[all]==0.10.1 +caikit[all]==0.25.0 requests==2.31.0 Pillow==9.5.0 click==8.1.3