Find answers from the community

Updated 2 months ago

hello guys i have a problem in my code

hello guys i have a problem in my code im using "sentence-transformers/all-mpnet-base-v2" as embedding model but when i run my code it said ValueError:
**
Could not load OpenAI embedding model. If you intended to use OpenAI, please check your OPENAI_API_KEY.
Original error:
No API key found for OpenAI.
Please set either the OPENAI_API_KEY environment variable or openai.api_key prior to initialization.
API keys can be found or created at https://platform.openai.com/account/api-keys

Consider using embed_model='local'.
Visit our documentation for more embedding options: https://docs.llamaindex.ai/en/stable/module_guides/models/embeddings.html#modules
** what sould i do ?
W
1 comment
Try defining this at the top:
Plain Text
from llama_index.core import Settings
Settings.embed_model = YOUR_EMBED_MODEL_HERE
Add a reply
Sign up and join the conversation on Discord