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

pyo3_runtime.PanicException: assertion failed: encoder.len() == decoder.len() #10

Open
zhang4014439175 opened this issue Apr 21, 2023 · 0 comments

Comments

@zhang4014439175
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
Traceback (most recent call last):
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/autogpt/main.py", line 5, in
autogpt.cli.main()
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/autogpt/cli.py", line 146, in main
agent.start_interaction_loop()
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/autogpt/agent/agent.py", line 75, in start_interaction_loop
assistant_reply = chat_with_ai(
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/autogpt/chat.py", line 95, in chat_with_ai
) = generate_context(prompt, relevant_memory, full_message_history, model)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/autogpt/chat.py", line 43, in generate_context
current_tokens_used = token_counter.count_message_tokens(current_context, model)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/autogpt/token_counter.py", line 25, in count_message_tokens
encoding = tiktoken.encoding_for_model(model)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/tiktoken/model.py", line 75, in encoding_for_model
return get_encoding(encoding_name)
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/tiktoken/registry.py", line 63, in get_encoding
enc = Encoding(**constructor())
File "/Users/mac/PycharmProjects/Auto-GPT-ZH/venv/lib/python3.10/site-packages/tiktoken/core.py", line 50, in init
self._core_bpe = _tiktoken.CoreBPE(mergeable_ranks, special_tokens, pat_str)
pyo3_runtime.PanicException: assertion failed: encoder.len() == decoder.len()

任何输入都会报此错误,错误发生在 self._core_bpe = _tiktoken.CoreBPE(mergeable_ranks, special_tokens, pat_str) 此行代码

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

1 participant