Error while cloning Space repository - No Build Logs

Hi, I’ve seen this post Error while cloning Space repository and 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.

Any help or guidance would be appreciated.

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.

One option is to download the model from the Hub. FYI spacy pipelines are really whl files, which means you can do pip install spacy_pipeline.whl. So for example you can go to spacy/en_core_web_lg · Hugging Face and 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 your requirements.txt file as a dependency, as done here.

1 Like

Thanks, Omar, this is very helpful.

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.

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")