You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Google Colab users, the Path.home() location is /root/, which is deleted when the runtime is cleared. As runtimes are cleared fairly often, this means re-downloading the KBs. Perhaps there is a way to alter Path.home from pathlib? Another option is to allow the user to enter a cache folder, which Colab users could set to their Google Drive (fwiw just a regular folder as seen by python within Colab), thus making the download permanent.
The text was updated successfully, but these errors were encountered:
davidshumway
changed the title
Enhancement: Provide option to modify cache folder entity linker knowledge base downloads
Enhancement: Provide option to modify cache folder for entity linker knowledge base downloads
Jan 26, 2022
I think you actually can do this, although admittedly I have not tried it. Can you try setting the SCISPACY_CACHE environment variable (used on this line
However, this alone does not find the cached files. It will re-download the files again. In order to see the new environment variable, it's necessary to restart the runtime: Runtime->Restart runtime.
Now when running the entity linker, it will see the permanently cached files.
So is an enhancement necessary? It'd definitely be easier and more foolproof to simply add a parameter such as cache_folder to the nlp.add_pipe() method. For example:
scispacy/scispacy/file_cache.py
Line 16 in 2290a80
For Google Colab users, the
Path.home()
location is/root/
, which is deleted when the runtime is cleared. As runtimes are cleared fairly often, this means re-downloading the KBs. Perhaps there is a way to alterPath.home
frompathlib
? Another option is to allow the user to enter a cache folder, which Colab users could set to their Google Drive (fwiw just a regular folder as seen by python within Colab), thus making the download permanent.The text was updated successfully, but these errors were encountered: