Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example in google lab cannot run in local #78

Closed
UndefeatedMagician opened this issue Apr 15, 2023 · 1 comment
Closed

example in google lab cannot run in local #78

UndefeatedMagician opened this issue Apr 15, 2023 · 1 comment

Comments

@UndefeatedMagician
Copy link

thread '' panicked at 'assertion failed: encoder.len() == decoder.len()', src\lib.rs:458:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

File ".\camel\agents\chat_agent.py", line 71, in step
num_tokens = num_tokens_from_messages(openai_messages, self.model)
encoding = tiktoken.encoding_for_model(model.value)
return get_encoding(encoding_name)
enc = Encoding(**constructor())
self._core_bpe = _tiktoken.CoreBPE(mergeable_ranks, special_tokens, pat_str)

@lightaime
Copy link
Member

Hi @hzhWord. It ran fine on my local machine. Do you have more information? It seems it is an error with tiktoken

Here is a suggestion from ChatGPT:

This error message suggests that there is an assertion failure in the Rust code at line 458 of the lib.rs file, indicating that the length of the encoder and decoder do not match.

It seems that this error is occurring within the context of a Python script, specifically in the step method of the chat_agent.py file. It's possible that the error is related to the interaction between the Python script and the Rust code it's using.

To further debug this error, you can try running the script with the RUST_BACKTRACE=1 environment variable to display a backtrace, which may provide additional information about the source of the problem. Additionally, you can try checking the input data and parameters passed to the Rust code and make sure they are formatted correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants