Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

panic with inference_session split_at #298

Closed
spion opened this issue Jun 6, 2023 · 3 comments
Closed

panic with inference_session split_at #298

spion opened this issue Jun 6, 2023 · 3 comments
Labels
issue:bug Something isn't working model:llama LLaMA model
Milestone

Comments

@spion
Copy link

spion commented Jun 6, 2023

When presenting / feeding certain tokens I'm getting:

thread 'main' panicked at 'assertion failed: mid <= self.len()', 
  /home/spion/.cargo/git/checkouts/llm-d8a8bbe144aa0546/e52a102/crates/llm-base/src/inference_session.rs:101:51

Steps to reproduce:

Feed the following string using feed_prompt

да гледам ќе идев

to any model that has llama like tokens.

Commit: latest master (e52a102)

@LLukas22
Copy link
Contributor

LLukas22 commented Jun 6, 2023

Are you using the Huggingface tokenizer or the tokenizer implemented directly into rustformers?

@spion
Copy link
Author

spion commented Jun 6, 2023

Oops, I forgot to meniton that really important bit. I'm using the HuggingFace tokenizer.

@philpax
Copy link
Collaborator

philpax commented Jun 28, 2023

Okay, took a bit of time, but I managed to find the root cause. The end of the UTF-8 decoding of the tokens with the Hugging Face tokenizer can actually change as more tokens are added (including being a shorter string!), leading to panics when what's already been decoded doesn't match what the new decoding has provided.

I've requested help here: huggingface/tokenizers#1141 (comment) - hoping that we can get to the bottom of this soon!

@philpax philpax added this to the 0.2 milestone Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue:bug Something isn't working model:llama LLaMA model
Projects
None yet
Development

No branches or pull requests

3 participants