Steps that would help someone when setting up gradio with hugging space
Okay, I actually trained the model in paperspace gradient and exported the model to make it work in local gradio site in my computer.. but unfortunatelly, it wasn’t a easy piloting.
I used this blog as the baseline for doing this "learning", it's been very helpful: blog First I figured out that my fastai version mismatched with the version that model was trained on, which was 2.7.19 , in today’s time. so when I tried to run it in my local computer it spewed errors, creating a conundrum of galaxies .. just because version is not good. I hate dependencies that are not reliable. anyways.
Fixed that , but then I got the error cannot instantiate posixpath on your system, because I was using windows, the privilege Macs have over windows.. I should have just shifted to my linux system, but alas it has low memory and power. So, I did , what I thought should be done on cloud, here I was using gradient, which was running on Linux, making me do the unthinkable that is to do the training in my local computer.
After finishing the training, I realized, the most important thing is to make sure that you put learn.path=Path('.'). otherwise you are going to waste another 30 mins, thank god I used jupyter notebook, so that the variable values were stored and not erased.
I uploaded it to hugging space in the same way I would a git repository and make sure to create a token for that, otherwise you can’t sign in.
You might get some errors here and there like putting images in the hugging space folder will retrack you from uploading it, so you have to git lfs command with your image.
Finally, you can't use the trained models in windows to host in hugging space, you have to use either paperspace gradient one, or if you're locally running a linux machine, then that's fine too.