From 4d15f1b563970e12f0fab8a96be7683cdd31f368 Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Wed, 16 Oct 2024 18:21:51 +0200 Subject: [PATCH] fix: update summarizer app to use correct url for token count Fixes #802 Signed-off-by: Jeff MAURY --- .../natural_language_processing/summarizer/app/summarizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/natural_language_processing/summarizer/app/summarizer.py b/recipes/natural_language_processing/summarizer/app/summarizer.py index b734bf0b..487e9f8b 100644 --- a/recipes/natural_language_processing/summarizer/app/summarizer.py +++ b/recipes/natural_language_processing/summarizer/app/summarizer.py @@ -58,7 +58,7 @@ def chunk_text(text): for chunk in text_chunks: chunk = chunk.page_content chunk_kwargs = request_kwargs | {"json": {"input": chunk}} - count = requests.post(f"{model_service[:-2]}/v1/extras/tokenize/count", **chunk_kwargs).content + count = requests.post(f"{model_service[:-2]}extras/tokenize/count", **chunk_kwargs).content count = json.loads(count)["count"] if count >= 2048: split_append_chunk(chunk, chunks)