diff --git a/.github/workflows/generate-webpage.yml b/.github/workflows/generate-webpage.yml index a81b6a6..d3d00e5 100644 --- a/.github/workflows/generate-webpage.yml +++ b/.github/workflows/generate-webpage.yml @@ -14,140 +14,19 @@ permissions: jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Run Python Script - uses: jannekem/run-python-script-action@v1.3 + - uses: BSFishy/pip-action@v1 with: - script: | - import os - import shutil - from urllib import request as ulreq + packages: | + requests + huggingface_hub + - uses: actions/checkout@v3 + with: + repository: jcdan3/devops + token: ${{ secrets.GITHUB_TOKEN }} + path: ${{ env.DEVOPS_DIR }} - import requests - from huggingface_hub import HfApi - from PIL import ImageFile - - - def getsizes(uri): - # https://stackoverflow.com/a/37709319 - # get file size *and* image size (None if not known) - file = ulreq.urlopen(uri) - size = file.headers.get("content-length") - if size: - size = int(size) - p = ImageFile.Parser() - while True: - data = file.read(1024) - if not data: - break - p.feed(data) - if p.image: - return size, p.image.size - break - file.close() - return (size, None) - - # Get list of models under the sd-concepts-library organization - api = HfApi() - models_list = [] - for model in api.list_models(author="sd-concepts-library"): - models_list.append(model.modelId.replace('sd-concepts-library/', '')) - models_list.sort() - print(models_list) - - html_struct = """ - -
-- Generated from huggingface.co/sd-concepts-library -
- -- Downloaded models are straight from the HuggingFace repositories and are named learned_embeds.bin. Rename to model_name.pt -
- - -