I don’t seem to quite understand how to deploy a model with a custom handler as an inference endpoint. Specifically, I’m trying to use this model (which alread has a custom handler): philschmid/stable-diffusion-v1-4-endpoints · Hugging Face
I went through these steps trying to follow the tutorial:
- Initialize Git LFS:
git lfs install
- Clone the desired repo:
git clone https://huggingface.co/philschmid/stable-diffusion-v1-4-endpoints
- Install huggingface-hub python package (in a venv):
python -m venv venv
+source venv/bin/activate
+pip install huggingface-hub
- Login to Huggingface:
huggingface-cli login
→ Choose Yes when asked to add token as git credential - Run this command (don’t really understand what it does):
git config --global credential.helper store
As far as I understand, I don’t need to change anything in the code, since it already has a custom handler. I now need to push the whole thing to a repo that I created before. It’s currently empty: shttps://huggingface.co/eykarim/stable-diffusion-v1
- I move up one folder into
/stable-diffusion-v1-4-endpoints
- I delete the existing
.git
so I can push the whole code to my own repo:sudo rm -r .git
- I initialize a new git:
git init
+git remote add origin master
+git remote set-url origin https://huggingface.co/eykarim/stable-diffusion-v1
- Add all files to commit to my new remote repo:
git add *
+git commit -m "my first commit"
+git push origin master
At this point I’m getting a git error error failed to push some refs to https://huggingface.co/eykarim/stable-diffusion-v1
As far as I understand this should be the right way. Once I have code with a handler.py in my repo, I should be able to find it in the inference endpoints search mask, right? (see screenshot)
Is this the right way to do it? And if so: Maybe someone could help me fix the Git error? That would be great!