my requirements.txt
spacy
my cloud function code:
import spacy
nlp = spacy.load("en_core_web_sm")
the error:
Function failed on loading user code. Error message: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
Your requirements.txt should look like this. The https link will directly download the spacy model and install it when you install the dependencies from requirements.txt. The spaCy models are valid python packages. Check this link for more details.
spacy
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz#egg=en_core_web_sm
You need to download the spaCy English model. Follow the instructions at: https://spacy.io/usage/models#quickstart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With