Failed to build invoke ui - get "ImportError" on "ModelSearchArguments"
Has this issue been opened before?
Describe the bug
On building with
docker compose --profile invoke up --build
get the following:
Which UI
invoke
Hardware / Software
- OS: Ubuntu 22.04
- OS version: 22.04.3 LTS
- Docker Version: 24.0.7
- Docker compose version: 2.21.0
Steps to Reproduce
- type: docker compose --profile invoke up --build
- See error
My bet is on huggingface_hub v0.19, which removed ModelSearchArguments completely.
Similar to @peacheniya solution for the torchmetrics issue, I went through dependencies and got something like the following in the ./services/invoke/Dockerfile after torchmetrics fix:
RUN --mount=type=cache,target=/root/.cache/pip \
pip uninstall -y huggingface-hub && \
pip install huggingface-hub==0.18
RUN --mount=type=cache,target=/root/.cache/pip \
pip uninstall -y transformers && \
pip install transformers==4.28
RUN --mount=type=cache,target=/root/.cache/pip \
pip uninstall -y werkzeug && \
pip install werkzeug==2.2.2
It does not fix the underlying issue, dependency on the old libraries, but at least makes it runnable.
RUN --mount=type=cache,target=/root/.cache/pip
pip uninstall -y huggingface-hub &&
pip install huggingface-hub==0.18RUN --mount=type=cache,target=/root/.cache/pip
pip uninstall -y transformers &&
pip install transformers==4.28RUN --mount=type=cache,target=/root/.cache/pip
pip uninstall -y werkzeug &&
pip install werkzeug==2.2.2
Sadly, doesn't work for me. Same error as before.
Hoping now for AbdBarho's fix to be merged.
To anyone else who runs into this issue before the update comes out, you can patch your copy by changing the following two lines in the middle of the invokeai/Dockerfile after the torchmetrics fix:
#git reset --hard f3b2e02921927d9317255b1c3811f47bd40a2bf9 && \
git reset --hard dedead672f2e9f995b6b96d7ada37456dab15b55 && \
#ARG BRANCH=main SHA=f3b2e02921927d9317255b1c3811f47bd40a2bf9
ARG BRANCH=main SHA=dedead672f2e9f995b6b96d7ada37456dab15b55
And then adding this third line right before COPY . /docker/:
RUN sed -i 's/https:\/\/civitai.com\/api\/download\/models\/63006/https:\/\/huggingface.co\/XpucT\/Loras\/resolve\/main\/LowRA_v2.safetensors?download=true/' invokeai/configs/INITIAL_MODELS.yaml
Apparently the bundled version of InvokeAI tries to pull a model (LowRA) from Civitai that's been removed (apparently the creator didn't like their updated T&Cs) but it seems to also be available on huggingface (LowRA_v2.safetensors)