-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
#The following code will throw the error (marked below)
import spacy
nlp = spacy.blank("en")
#this next line throws the error below
llm_ner = nlp.add_pipe("llm_ner")
spaCy Error:
C:\Program Files\Python311\Lib\site-packages\spacy_llm\models\rest\openai\model.py:25: UserWarning: Could not find the API key to access the OpenAI API. Ensure you have an API key set up via https://platform.openai.com/account/api-keys, then make it available as an environment variable 'OPENAI_API_KEY'.
Why is this defaulting to the OpenAI model? Is there a way to bypass this such that other models from HuggingFace (e.g. Dolly) or spaCy's own LLM models can be used for NER recognition?
Thanks for your help.
Ronny
My Environment
============================== Info about spaCy ==============================
spaCy version 3.7.2
Location C:\Program Files\Python\Lib\site-packages\spacy
Platform Windows-11-10.0.22621-SP0
Python version 3.12.0
Pipelines en_core_web_lg (3.7.0), en_core_web_md (3.7.0), en_core_web_sm (3.7.0)