How do I use Binder with a GitHub repo that has Git-lfs files?

I’m trying to use Binder to share my Git repo, but the git repo has git-lfs files.

If I try to use the repo when pointer files to the git-lfs files are present instead of the actual files, I get the following error from Binder: Smudge error: Error downloading: [404] Object does not exist on the server.

If I try to use the repo when the actual git-lfs files are present, I get an ImagePullBackError from Binder.

I’ve tried building the image before I uploaded these files and afterwards, but I get the above-mentioned error each time.

Also, it seems like Binder doesn’t rebuild the image, even after a new commit.

i’m not sure, but you might want to try hosting on google drive instead of git-lfs

you can upload your model like this (scroll to first animated gif)

and the pull it down using this (scroll to Download Model)

I’m just about to release an inference webapp that might be a nice substitute for binder, but in the mean time, hope these snippets help. let me know if something doesn’t make sense.

Thanks for the tip! I’ll try it out now.

I got this error when I tried to load a fastai .pkl file into the .ipynb file in Binder. Could this be an issue with uploading the model files to Google Drive, a requirements.txt issue, a runtime issue (I don’t know how Binder handles it since it didn’t process my runtime.txt file), or something else?

do you want to share your notebook that loads the learner?

Sure. Here’s the repo:

the notebook has some errors, i think it is missing some pip installs for modules. but, the models would not have downloaded correctly.

i changed the first 3 cells i this notebook, and you can verify the 3 files are in the right folder.

Thanks for the edit. I actually used Binder to build the repo, so that’s probably why some of the modules aren’t there. I’ll try it out and see if it works.

I tried it out, but I still get the same error. You can build the repo on Binder to recreate the issue. Any thoughts?

when running binder, i see this
ModuleNotFoundError: No module named ‘spacy.lemmatizer’
just a guess, you can try adding spacy to your requirements?

if that doesn’t work, if you’d like to, we can chat to see if your app is a fit for what I’m working on.

Oh sorry, I tried unpinning the versions of my dependencies in requirements.txt. Spacy should be of version 2.2.4.

cool. glad you got it.

But even when I do this, I still get the error. So the problem could be with the files going through Google Drive, or a runtime.txt issue, since the file doesn’t seem to be respected by Binder.

I have no idea. I see the files in the model dir, so I don’t think that would be issue. This line makes me think it’s some kind of missing class version or something like that

AttributeError: type object ‘EnglishDefaults’ has no attribute ‘is_base_form’

Ok, thanks for your help. I’ve been talking with another person on SO (git lfs - How do I use Binder with a GitHub repo that has Git-lfs files? - Stack Overflow), and we think that if editing the runtime.txt file doesn’t work, I’ll try adding an environment.yml file. If that doesn’t work, then we think there’s probably something wrong with the files after I download them from Drive into Binder.

cool. good luck.