Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug? CHECKPOINT_URL doesn't work #2

Open
jochemstoel opened this issue Feb 28, 2023 · 2 comments
Open

Bug? CHECKPOINT_URL doesn't work #2

jochemstoel opened this issue Feb 28, 2023 · 2 comments

Comments

@jochemstoel
Copy link

I think there might be a bug? I entered a checkpoint URL in the dockerfile but it tried to download a model from HuggingFace in stead.

# Unlikely you'll ever want to change this.
ARG FROM_IMAGE="gadicc/diffusers-api"
FROM ${FROM_IMAGE} as base
ENV FROM_IMAGE=${FROM_IMAGE}

# Added by Super Jochem
ARG HF_AUTH_TOKEN="***********************"
ENV HF_AUTH_TOKEN=${HF_AUTH_TOKEN}


# Model id, precision, etc.
ARG MODEL_ID="bewbs"
ENV MODEL_ID=${MODEL_ID}
ARG HF_MODEL_ID=""
ENV HF_MODEL_ID=${HF_MODEL_ID}
ARG MODEL_PRECISION=""
ENV MODEL_PRECISION=${MODEL_PRECISION}
ARG MODEL_REVISION=""
ENV MODEL_REVISION=${MODEL_REVISION}
#ARG MODEL_URL="s3://"
ARG MODEL_URL=""
ENV MODEL_URL=${MODEL_URL}

# To use a .ckpt file, put the details here.
ARG CHECKPOINT_URL="https://*****/models/sd/bewbs.ckpt"
ENV CHECKPOINT_URL=${CHECKPOINT_URL}
ARG CHECKPOINT_CONFIG_URL=""
ENV CHECKPOINT_CONFIG_URL=${CHECKPOINT_CONFIG_URL}

ARG PIPELINE="ALL"
ENV PIPELINE=${PIPELINE}

# AWS / S3-compatible storage (see docs)
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
# AWS, use "us-west-1" for banana; leave blank for Cloudflare R2.
ARG AWS_DEFAULT_REGION
ARG AWS_S3_DEFAULT_BUCKET
# Only if your non-AWS S3-compatible provider told you exactly what
# to put here (e.g. for Cloudflare R2, etc.)
ARG AWS_S3_ENDPOINT_URL

ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
ENV AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
ENV AWS_S3_DEFAULT_BUCKET=${AWS_S3_DEFAULT_BUCKET}
ENV AWS_S3_ENDPOINT_URL=${AWS_S3_ENDPOINT_URL}

# Download the model
ENV RUNTIME_DOWNLOADS=0
RUN python3 download.py

# Send (optionally signed) status updates to a REST endpoint
ARG SEND_URL="https://*******/echo"
ENV SEND_URL=${SEND_URL}
ARG SIGN_KEY
ENV SIGN_KEY=${SIGN_KEY}

# Override only if you know you need to turn this off
ARG SAFETENSORS_FAST_GPU=1
ENV SAFETENSORS_FAST_GPU=${SAFETENSORS_FAST_GPU}

CMD python3 -u server.py

Error:

{"stream":"\u001b[91m    download_model(\n  File \"/api/download.py\", line 148, in download_model\n\u001b[0m"}
{"stream":"\u001b[91m    loadModel(\n  File \"/api/loadModel.py\", line 52, in loadModel\n\u001b[0m"}
{"stream":"\u001b[91m    scheduler = getScheduler(model_id, DEFAULT_SCHEDULER, not load)\n  File \"/api/getScheduler.py\", line 88, in getScheduler\n\u001b[0m"}
{"stream":"\u001b[91m    scheduler = initScheduler(MODEL_ID, scheduler_id, download)\n  File \"/api/getScheduler.py\", line 50, in initScheduler\n\u001b[0m"}
{"stream":"\u001b[91m    inittedScheduler = scheduler.from_pretrained(\n\u001b[0m"}
{"stream":"\u001b[91m  File \"/api/diffusers/src/diffusers/schedulers/scheduling_utils.py\", line 134, in from_pretrained\n\u001b[0m"}
{"stream":"\u001b[91m    config, kwargs = cls.load_config(\n  File \"/api/diffusers/src/diffusers/configuration_utils.py\", line 341, in load_config\n\u001b[0m"}
{"stream":"\u001b[91m    raise EnvironmentError(\nOSError: bewbs is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a token having permission to this repo with `use_auth_token` or log in with `huggingface-cli login`.\n\u001b[0m"}
{"stream":"\u001b[91mERROR conda.cli.main_run:execute(47): `conda run /bin/bash -c python3 download.py` failed. (See above for error)\n\u001b[0m"}
@gadicc
Copy link
Contributor

gadicc commented Feb 28, 2023

Hey @jochemstoel, thanks for the report. I just checked and can confirm this issue exists in the latest published non-dev release (latest / 1.3.0). Seems like it's already fixed in dev though (I checked too, and it downloads and converts without errors). I guess it's probably time to publish all the recent dev stuff, but in the meantime, it's super easy to switch versions with the new architecture. Just edit the Dockerfile and change:

ARG FROM_IMAGE="gadicc/diffusers-api"     # from this
ARG FROM_IMAGE="gadicc/diffusers-api:dev" # to this

(or set FROM_IMAGE build-var in banana dashboard, but from what I understand, you still need to push a change to the repo anyway to trigger a rebuild).

In case you want to pin to the exact current dev release, instead of :dev (which will pull in future dev releases on subsequent builds), you could put @sha256:d74da6a89985bc12ea9d5601f5e35597bed0cbb89137e40a9a91ce37bf08785e. That's just FYI; you definitely don't need to do that :) And I'll probably merge to main soon regardless (which will come in as :latest and also get it's own semver version).

@gadicc
Copy link
Contributor

gadicc commented Mar 1, 2023

P.S. I did in fact merge to main after my post yesterday, but had to go before the CI finished. In any case, the most recent dev release at time of writing was published as latest / 1.4.0 on docker hub https://hub.docker.com/r/gadicc/diffusers-api/tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants