Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
add windows test (#135)
Browse files Browse the repository at this point in the history
* add windows test

* add new line

Signed-off-by: Wenxin Zhang <[email protected]>
  • Loading branch information
VincyZhang authored Feb 22, 2024
1 parent 8c846d6 commit b5d5673
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/scripts/prepare_env_with_conda.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
SET conda_env_name=windows_build_ns
SET python_version=3.10
cd ../../..

FOR /F %%i IN ('conda info -e ^| find /c "%conda_env_name%"') do SET CONDA_COUNT=%%i
if %CONDA_COUNT% EQU 0 (
CALL conda create python=%python_version% -y -n %conda_env_name%
)

IF %ERRORLEVEL% NEQ 0 (
echo "Could not create new conda environment."
exit 1
)
CALL conda activate %conda_env_name%
CALL pip uninstall neural-speed -y
echo "pip list all the components------------->"
CALL pip list
CALL pip install -U pip
echo "Installing requirements for validation scripts..."
CALL pip install -r requirements.txt
echo "pip list all the components------------->"
CALL pip list
echo "------------------------------------------"
IF %ERRORLEVEL% NEQ 0 (
echo "Could not install requirements."
exit 1
)

git submodule update --init --recursive
python setup.py sdist bdist_wheel
IF %ERRORLEVEL% NEQ 0 (
echo "Could not build binary."
exit 1
)
45 changes: 45 additions & 0 deletions .github/workflows/windows-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Windows Binary Test

on:
pull_request:
branches: [main]
paths:
- ".github/workflows/windows-test.yml"
- "requirements.txt"
- "setup.py"
- "neural_speed/**"
- "bestla/**"
- '!bestla/ut/**'
- '!bestla/xbyak/**'
- '!bestla/xbyak/*.md'
- '!neural_speed/*.md'

workflow_dispatch:

# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
SCRIPT_PATH: ${{ github.workspace }}\.github\workflows\script
WORKING_DIR: ${{ github.workspace }}

jobs:
Windows-Binary-Test:
runs-on: 'Windows'
steps:
- name: Checkout out Repo
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-tags: true
path: "a"

- name: Binary build
shell: cmd
run: |
SET HTTP_PROXY=${{ vars.HTTP_PROXY_WINDOWS }}
SET HTTPS_PROXY=${{ vars.HTTP_PROXY_WINDOWS }}
cd ${{ github.workspace }}\a\.github\workflows\scripts
prepare_env_with_conda.bat
2 changes: 1 addition & 1 deletion scripts/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(args_in: Optional[List[str]] = None) -> None:
dir_model = snapshot_download(repo_id=str(args.model), resume_download=True, token=args.token)
except Exception as e:
if e.response.status_code == 401:
print("You are required to input an acccess token ID for {}, please add it in option --token or download model weights locally".format(args.model))
print("You are required to input an access token ID for {}, please add it in option --token or download model weights locally".format(args.model))
sys.exit(f"{e}")

convert_model(dir_model, args.outfile, args.outtype, use_quantized_model=args.use_quantized_model)
Expand Down
2 changes: 1 addition & 1 deletion scripts/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def main(args_in: Optional[List[str]] = None) -> None:
# Handles Missing token ID for gated models
except Exception as e:
if e.response.status_code == 401:
print("You are required to input an acccess token ID for {}, please add it in option --token or download model weights locally".format(args.model))
print("You are required to input an access token ID for {}, please add it in option --token or download model weights locally".format(args.model))
sys.exit(f"{e}")

parent_path = Path(__file__).parent.absolute()
Expand Down

0 comments on commit b5d5673

Please sign in to comment.