From 3b380f0a9df3cde79b54fe306c79987b86b3af6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 22:33:11 +0000 Subject: [PATCH 1/3] Bump gradio from 3.36.1 to 4.11.0 Bumps [gradio](https://github.com/gradio-app/gradio) from 3.36.1 to 4.11.0. - [Release notes](https://github.com/gradio-app/gradio/releases) - [Changelog](https://github.com/gradio-app/gradio/blob/main/CHANGELOG.md) - [Commits](https://github.com/gradio-app/gradio/commits) --- updated-dependencies: - dependency-name: gradio dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 995a511..e6e8440 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ timm==0.9.1 sentence-transformers==2.2.2 transformers[torch]==4.30.0 # frontend only -gradio==3.36.1 +gradio==4.11.0 grpcio==1.53.2 From 8391e7c252e2321f0ee19be45276b61a175e1735 Mon Sep 17 00:00:00 2001 From: markstur Date: Wed, 10 Jan 2024 15:51:24 -0800 Subject: [PATCH 2/3] Fix to work with updated gradio * To allow the gradio update recommended by dependabot * launch param show_tips removed * DataFrame for token embedding output needs a str key (columns) * Gallery style() is gone with kwargs moved to Gallery constructor. Signed-off-by: markstur --- caikit_huggingface_demo/app.py | 2 +- caikit_huggingface_demo/client/embeddings.py | 2 +- caikit_huggingface_demo/client/image_segmentation.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/caikit_huggingface_demo/app.py b/caikit_huggingface_demo/app.py index dbda740..d2fdcda 100755 --- a/caikit_huggingface_demo/app.py +++ b/caikit_huggingface_demo/app.py @@ -131,7 +131,7 @@ def start_frontend(backend, inference_service): channel = grpc.insecure_channel(target) frontend = get_frontend(channel, inference_service, module_models) print(f"▶️ Starting the frontend gradio UI with using backend target={target}") - frontend.launch(share=False, show_tips=False) + frontend.launch(share=False) print("⏹️ Stopped") diff --git a/caikit_huggingface_demo/client/embeddings.py b/caikit_huggingface_demo/client/embeddings.py index 14aa146..4443403 100644 --- a/caikit_huggingface_demo/client/embeddings.py +++ b/caikit_huggingface_demo/client/embeddings.py @@ -33,7 +33,7 @@ def fn(self, model, text_in): columns = [] rows = [] for k in response.output: - columns.append(k.input) + columns.append(str(k.input)) for r, _ in enumerate(response.output[0].output): row = [] diff --git a/caikit_huggingface_demo/client/image_segmentation.py b/caikit_huggingface_demo/client/image_segmentation.py index 5dddcd9..4e8d554 100644 --- a/caikit_huggingface_demo/client/image_segmentation.py +++ b/caikit_huggingface_demo/client/image_segmentation.py @@ -87,8 +87,7 @@ def optional_tab(cls, models, request, predict): with gr.Column(): inputs = gr.Image(label="Input Image") output_image = gr.Gallery( - label="Output Masks", show_label=True - ).style(preview=True, object_fit="scale-down") + label="Output Masks", show_label=True, preview=True, object_fit="scale-down") with gr.Column(): outputs = gr.Label(label="Segments Detected") inputs.change( From d79f381a609b78b255871def0a22dfc1729ae0e5 Mon Sep 17 00:00:00 2001 From: markstur Date: Wed, 10 Jan 2024 16:00:17 -0800 Subject: [PATCH 3/3] Prettier formatting Signed-off-by: markstur --- caikit_huggingface_demo/client/image_segmentation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/caikit_huggingface_demo/client/image_segmentation.py b/caikit_huggingface_demo/client/image_segmentation.py index 4e8d554..8033a74 100644 --- a/caikit_huggingface_demo/client/image_segmentation.py +++ b/caikit_huggingface_demo/client/image_segmentation.py @@ -87,7 +87,11 @@ def optional_tab(cls, models, request, predict): with gr.Column(): inputs = gr.Image(label="Input Image") output_image = gr.Gallery( - label="Output Masks", show_label=True, preview=True, object_fit="scale-down") + label="Output Masks", + show_label=True, + preview=True, + object_fit="scale-down", + ) with gr.Column(): outputs = gr.Label(label="Segments Detected") inputs.change(