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

Error choosing agent: Unknown encoding o200k_base. Plugins found: ['tiktoken_ext.openai_public'] #560

Closed
mesbahkhan opened this issue Jun 1, 2024 · 2 comments

Comments

@mesbahkhan
Copy link

I am getting the following error when running the basic example code from https://docs.gptr.dev/docs/examples/examples

.🔎 Starting the research task for 'What happened in the latest burning man floods?'...
Error choosing agent: Unknown encoding o200k_base. Plugins found: ['tiktoken_ext.openai_public']

File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\master\agent.py", line 96, in conduct_research
context = await self.__get_context_by_search(self.query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\master\agent.py", line 177, in __get_context_by_search
sub_queries = await get_sub_queries(query=query, agent_role_prompt=self.role,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\master\actions.py", line 99, in get_sub_queries
response = await create_chat_completion(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\utils\llm.py", line 102, in create_chat_completion
llm_costs = estimate_llm_cost(str(messages), response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\utils\costs.py", line 13, in estimate_llm_cost
encoding = tiktoken.get_encoding(ENCODING_MODEL)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\S\python\ai_services\Lib\site-packages\tiktoken\registry.py", line 68, in get_encoding
raise ValueError(
ValueError: Unknown encoding o200k_base. Plugins found: ['tiktoken_ext.openai_public']

@assafelovic
Copy link
Owner

Do you have tiktoken installed to latest version?
pip install tiktoken -U

@mesbahkhan
Copy link
Author

Yes that did the trick, thanks @assafelovic

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