Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download "en_core_web_sm" model at runtime in spacy?

I am working on writing a lambda function which depends on Spacy's "en_core_web_sm" model. Due to limitation of AWS Lambda, I need to find a mechanism which allows me to download the model at runtime (I can afford to increase the lambda timeout).

Note: I can't use EFS at the moment due to some requirement restriction.

like image 940
Vikas Gupta Avatar asked Oct 23 '25 19:10

Vikas Gupta


1 Answers

You can do this.

from spacy.cli import download

download("en_core_web_sm")

See the source.

like image 121
polm23 Avatar answered Oct 26 '25 11:10

polm23