FileNotFoundError: [Errno 2] No such file or directory: 'local-ner-cache/9963044417883968883.spacy'

I changed the spacy.NER.v2 to spacy.NER.v3

ValueError: Prompt template in cache directory (local-ner-cache/prompt_template.txt) is not equal with current prompt template. Reset your cache if you are using a new prompt template.

After deleting the folder local-ner-cache, I encountered the following error:

FileNotFoundError: [Errno 2] No such file or directory: 'local-ner-cache/9963044417883968883.spacy'

What is the right way to "Reset your cache if you are using a new prompt template."?

Because after the deleting the folder local-ner-cache, I'm no longer able to annotate the same dataset:

dotenv run -- prodigy ner.llm.correct

image

There are still around 1k samples to annotate.

Hi @nikolaysm ,

I'm having trouble reproducing what you're reporting.
In general, the way to "Reset your cache if you are using a new prompt template."? is to set another cache folder in your new config file. Or to delete the existing cache folder (if you're not going to use it). Either way, you do should use a separate cache per spacy-llm config.

The FileNotFound:

FileNotFoundError: [Errno 2] No such file or directory: 'local-ner-cache/9963044417883968883.spacy'

was thrown when you deleted the local-ner-cache and restarted the recipe with the same command and the same config?

Also, which Prodigy version are you running?

Thanks!

Hi @magdaaniol and thanks for your reply,

That is what I have done!

Yes, it happened after deleting the folder local-ner-cache .

I'm using Prodigy v1.14.12

One more question, as it is not immediately obvious to me what could be at play here: does the FileNotFound error happens consistently for you?

It appears that the FileNotFound error occurs specifically after I delete the cache directory. Subsequently, I've opted to refrain from deleting the entire cache directory and instead only delete the prompt file to mitigate the risk.

Unfortunately, I don't have the full traceback at the moment. In future instances of encountering the error, I plan to share the traceback for a more detailed analysis.

Additionally, I have created an issue on GitHub.

Hey @nikolaysm ,

It looks like it's spacy-llm internal issue. Let's continue the discussion here: FileNotFoundError: [Errno 2] No such file or directory: 'local-ner-cache/9963044417883968883.spacy' · Issue #414 · explosion/spacy-llm · GitHub (linking your GitHub issue for the benefit of the community - thanks!)