Update llama.py: Added how many input tokens in ValueError exception

This commit is contained in:
imaprogrammer 2023-06-16 14:11:57 +05:30 committed by GitHub
parent d938e59003
commit fd9f294b3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -814,7 +814,7 @@ class Llama:
llama_cpp.llama_reset_timings(self.ctx)
if len(prompt_tokens) > self._n_ctx:
raise ValueError(f"Requested tokens exceed context window of {self._n_ctx}")
raise ValueError(f"Requested tokens ({len(prompt_tokens)}) exceed context window of {self._n_ctx}")
# Truncate max_tokens if requested tokens would exceed the context window
max_tokens = (