Skip to content

Replace detokenize with binary search based truncation#780

Open
sats-23 wants to merge 2 commits into
IBM:mainfrom
sats-23:rmDeto
Open

Replace detokenize with binary search based truncation#780
sats-23 wants to merge 2 commits into
IBM:mainfrom
sats-23:rmDeto

Conversation

@sats-23
Copy link
Copy Markdown
Contributor

@sats-23 sats-23 commented May 21, 2026

No description provided.


@retry_on_transient_error(max_retries=3, initial_delay=1.0, backoff_multiplier=2.0)
def detokenize_with_llm(tokens, emb_endpoint, max_retries=3):
def truncate_text_to_token_limit(text, token_limit, llm_endpoint):
Copy link
Copy Markdown
Member

@dharaneeshvrd dharaneeshvrd May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this need to be inside misc_utils.py
Do you think it would make sense to use detokenize in method name?
I wanted it to be a generic replacement for detokenize so that in future if there are some other requirement for detokenize, we can make use of this.

Comment thread services/chatbot/Makefile Outdated
REGISTRY?=icr.io/ai-services-private
IMAGE=chatbot-service
TAG?=v0.0.107
TAG?=v0.0.108
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can't bump this
first you need to bump common
then in a follow up PR we need to use the updated common version in chatbot service.
I think we have to revisit this part. I feel we need to have different strategy to use common in services.

Signed-off-by: Sathvik <Sathvik.S@ibm.com>
Signed-off-by: Sathvik <Sathvik.S@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants