feat: enable ModelLoaderHuggerFace
to support loading models in fp16 for inference
#1690
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python checks | |
env: | |
ONEFLOW_SRC: oneflow-src | |
on: | |
pull_request: | |
types: [opened, review_requested, ready_for_review, synchronize, unlocked] | |
branches: | |
- "*" | |
workflow_dispatch: | |
inputs: | |
placeholder: | |
description: "placeholder, no effect" | |
required: false | |
jobs: | |
check_license_and_format: | |
name: License and format | |
runs-on: ubuntu-20.04 | |
if: github.event.pull_request.draft == false && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.6 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.6' | |
- name: Install dependencies | |
# flake8-bugbear flake8-comprehensions are useful but not available internally | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8==3.8.1 isort==5.10.1 | |
python -m pip install black==21.4b2 | |
flake8 --version | |
- name: Lint | |
id: py_check | |
run: | | |
isort --check . | |
black -l 100 --check . | |
flake8 . | |
- name: Please request CI again | |
if: ${{ failure() }} | |
run: | | |
exit 1 | |
run_unittest: | |
name: unit tests | |
runs-on: ubuntu-20.04 | |
if: github.event.pull_request.draft == false && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cpu | |
python -m pip install pybind11 | |
python -m pip install torch torchvision torchaudio | |
- name: Build and install | |
run: | | |
python -m pip install -e . | |
- name: Run unittest | |
run: | | |
cd dev && bash run_unittest.sh | |
- name: Please request CI again | |
if: ${{ failure() }} | |
run: | | |
exit 1 |