Hello guys. I have this issue when I try to use the API. I Used it exactly 2 days ago and it was working fine. I have been running the same code with no errors at all. I am using Google Colab with LangChain and FAISS; and got my packages up-to-date. Now after the recent updates on GPT-4 Turbo I get these errors:
AttributeError Traceback (most recent call last)
in <cell line: 2>()
1 from langchain.llms import OpenAI
----> 2 llm = OpenAI(model_name=“text-davinci-003”)
3 frames
/usr/local/lib/python3.10/dist-packages/langchain/llms/openai.py in validate_environment(cls, values)
264 import openai
265
→ 266 values[“client”] = openai.Completion
267 except ImportError:
268 raise ImportError(
AttributeError: module ‘openai’ has no attribute ‘Completion’
and
AttributeError: module 'openaAttributeError Traceback (most recent call last)
in <cell line: 6>()
4 docs = text_splitter.split_documents(documents)
5
----> 6 faissIndex = FAISS.from_documents(docs, OpenAIEmbeddings())
7 faissIndex.save_local(“graduate_studies_docs”)#saves a folder to hold index.faiss and index.pkl
2 frames
/usr/local/lib/python3.10/dist-packages/langchain/embeddings/openai.py in validate_environment(cls, values)
282 import openai
283
→ 284 values[“client”] = openai.Embedding
285 except ImportError:
286 raise ImportError(
AttributeError: module ‘openai’ has no attribute ‘Embedding’
Is this because of the new updates or what? What to do please?