Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLM models in spaCy requiring OpenAI key #13076

Closed
rshahrabani opened this issue Oct 21, 2023 · 1 comment
Closed

LLM models in spaCy requiring OpenAI key #13076

rshahrabani opened this issue Oct 21, 2023 · 1 comment
Labels
feat/llm Feature: LLMs (incl. spacy-llm)

Comments

@rshahrabani
Copy link

#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)

@shadeMe shadeMe added the feat/llm Feature: LLMs (incl. spacy-llm) label Oct 23, 2023
@svlandeg
Copy link
Member

Let me transfer this to the discussion as we aim to keep the issue tracker focused on bugs and feature requests ;-)

@explosion explosion locked and limited conversation to collaborators Oct 23, 2023
@svlandeg svlandeg converted this issue into discussion #13080 Oct 23, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feat/llm Feature: LLMs (incl. spacy-llm)
Projects
None yet
Development

No branches or pull requests

3 participants