Find answers from the community

Updated 7 months ago

Tiktoken

At a glance

The community member is trying to use an ObjectIndex constructor for SQL Query-Time Retrieval of Tables for Text-to-SQL queries. The code runs fine in a Jupyter notebook, but when run in a .py file, it gives a ValueError: Duplicate encoding name gpt2 in tiktoken plugin tiktoken_ext.openai_public error. A community member suggests that the issue might be related to the tiktoken package and recommends upgrading or downgrading it, but there is no explicitly marked answer.

I am trying to use an ObjectIndex constructor for SQL Query-Time Retrieval of Tables for Text-to-SQL queries. This is the code I use:

Plain Text
obj_index = ObjectIndex.from_objects(
    table_schema_objs,
    table_node_mapping,
    VectorStoreIndex,
)

The code runs fine in a jupyter notebook but the same code strangely gives me an error when I run in .py file. It gives me this error:

Plain Text
ValueError: Duplicate encoding name gpt2 in tiktoken plugin tiktoken_ext.openai_public

Not sure what to make of it
L
1 comment
Uhhh hmm, maybe upgrade or downgrade the tiktoken package? Haven't seen this one before
Add a reply
Sign up and join the conversation on Discord