Skip to content

add

add #16

Workflow file for this run

name: HF clone
on:
push:
branches:
- "clone-model"
workflow_dispatch:
inputs:
url:
description: "url to download"
required: true
ossPath:
default: "oss://oneflow-static/hf_hub"
required: false
description: "path to put file"
concurrency:
group: clone-hub-${{ github.ref }}
cancel-in-progress: true
jobs:
clone_model:
name: ${{ matrix.task.src_url }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task:
- {
src_url: "https://huggingface.co/lllyasviel/sd-controlnet-canny/resolve/main/diffusion_pytorch_model.bin",
dst_oss_url: "oss://oneflow-static/hf_hub/sd-controlnet-canny/diffusion_pytorch_model.bin",
}
- {
src_url: "https://huggingface.co/lllyasviel/sd-controlnet-canny/resolve/main/diffusion_pytorch_model.safetensors",
dst_oss_url: "oss://oneflow-static/hf_hub/sd-controlnet-canny/diffusion_pytorch_model.safetensors",
}
- {
src_url: "https://huggingface.co/lllyasviel/sd-controlnet-canny/resolve/main/images/bird.png",
dst_oss_url: "oss://oneflow-static/hf_hub/sd-controlnet-canny/images/bird.png",
}
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
overprovision-lvm: "true"
- env:
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }}
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
run: |
set -x
mkdir -p $HOME/bin
curl http://gosspublic.alicdn.com/ossutil/1.6.19/ossutil64 -o $HOME/bin/ossutil64
chmod 755 $HOME/bin/ossutil64
export PATH=$PATH:$HOME/bin
ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${OSS_ACCESS_KEY_ID} -k ${OSS_ACCESS_KEY_SECRET} -L EN -c $HOME/.ossutilconfig
wget --quiet ${{ matrix.task.src_url }} -O tmpf
ossutil64 cp -f tmpf ${{ matrix.task.dst_oss_url }}