Error while cloning Space repository - No Build Logs
Hi, I’ve seen this postError while cloning Space repositoryand wanted to check if I am experiencing a server error or if I’ve done something wrong. My app was working a few days ago, but when I went to share it with someone I encountered a build error (see below). There are no Build Logs or I’d provide those as well.2022-06-15_15-20-28914×423 28.2 KBAny help or guidance would be appreciated.
2022-06-16T23:59:30Z
I deleted the contents of the repository and pushed it back to identify the problem. It appears to be my usage of spaCy “en_web_core_lg” using LFS. I have updated the code to download it the first time the app loads, but I feel this is very computationally inefficient. So any guidance on how to get a stable spaCy model into my Spaces repository would be appreciated.
2022-06-18T16:43:18Z
One option is to download the model from the Hub. FYIspacypipelines are reallywhlfiles, which means you can dopip install spacy_pipeline.whl.  So for example you can go tospacy/en_core_web_lg · Hugging Faceand do!pip install https://huggingface.co/spacy/en_core_web_lg/resolve/main/en_core_web_lg-any-py3-none-any.whl. Likewise, you can specify this in yourrequirements.txtfile as a dependency, as donehere.
2022-06-18T17:22:39Z
Thanks, Omar, this is very helpful.osanseviero:Likewise, you can specify this in yourrequirements.txtfile as a dependency, as donehere.I believe I got this to work. I didn’t realize you could put direct links to wheels in the requirements.txt to have models included in the image. This is really helpful.osanseviero:So for example you can go tospacy/en_core_web_lg · Hugging Faceand do!pip install https://huggingface.co/spacy/en_core_web_lg/resolve/main/en_core_web_lg-any-py3-none-any.whl.Just checking on this option for a sanity check. I tried to do this in my app.py script and it threw an error. When I installed the model on my local machine within the repository it didn’t get pushed to the Spaces instance. If I were to try this implementation, is app.py the right location?I ended up using the code below to get around the error I ran into. I doubt it’s the right way to go, but it worked until you pointed out that I can include it in the requirements.txt.try:
    nlp = spacy.load("en_core_web_lg")
except:
    script = "python -m spacy download en_core_web_lg"
    os.system("bash -c '%s'" % script)
nlp = spacy.load("en_core_web_lg")