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

Torch installation fix for Windows intel GPU #96

Merged
merged 7 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [3.7, 3.8, 3.9]
# experimental: [ false ]
# include:
# - python-version: 3.10
# experimental: true
# continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v2
Expand All @@ -35,7 +30,12 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
pip install --editable . -v

- name: Install Pytorch on windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
pip install torch==1.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

- name: Lint with flake8
run: |
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ tldextract==3.1.0
# via presidio-analyzer
tokenizers==0.10.2
# via transformers
torch==1.8.1; sys_platform != 'win32' and sys_platform != 'cygwin'
torch==1.8.1+cpu; sys_platform == 'win32' or sys_platform == 'cygwin'
torch==1.8.1; sys_platform != '*win*'
# via -r requirements.in
tqdm==4.60.0
# via
Expand Down
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import logging
import pathlib
from io import open
from sys import platform

from setuptools import find_packages, setup

logger = logging.getLogger(__name__)

if "win" in platform:
warning_message = """
------------------------------------------------------------------------------------------------
NOTE: For windows platform install torch manually. Refer https://pytorch.org/get-started/locally/
------------------------------------------------------------------------------------------------
"""
logger.warning(warning_message)
print(warning_message)


def parse_requirements(filename):
with open(filename) as file:
Expand Down