MaartenGr / BERTopic

Leveraging BERT and c-TF-IDF to create easily interpretable topics.
https://maartengr.github.io/BERTopic/
MIT License
6k stars 752 forks source link

OPENAIBackend has no attribute "encode" #1748

Open luqmanoxyz opened 8 months ago

luqmanoxyz commented 8 months ago

Hi,

I am trying to use 'text-embedding-ada-002' as my embedding model. But i keep getting the error below when i try to run pre-calculated embeddings (it seems like 'encode' does not work with the openai>1.0 library):


AttributeError Traceback (most recent call last) in <cell line: 6>() 4 client = openai.OpenAI() 5 embedding_model = OpenAIBackend(client, "text-embedding-ada-002") ----> 6 embeddings = embedding_model.encode(reviews, show_progress_bar=True)

AttributeError: 'OpenAIBackend' object has no attribute 'encode'

MaartenGr commented 8 months ago

You should use the latest commit in the main branch as this was fixed there I believe.