diff --git a/install.py b/install.py index b258fe3ad1..70de20a9e3 100644 --- a/install.py +++ b/install.py @@ -2,16 +2,13 @@ import subprocess import os import sys -from utils import TORCH_DEPS, proxy_suggestion, get_pkg_versions, _test_https +from utils import TORCH_DEPS, get_pkg_versions from userbenchmark import list_userbenchmarks from pathlib import Path REPO_ROOT = Path(__file__).parent def pip_install_requirements(requirements_txt="requirements.txt"): - if not _test_https(): - print(proxy_suggestion) - sys.exit(-1) try: subprocess.run([sys.executable, '-m', 'pip', 'install', '-q', '-r', requirements_txt], check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) diff --git a/torchbenchmark/__init__.py b/torchbenchmark/__init__.py index 1445b05122..bebcbe9f2b 100644 --- a/torchbenchmark/__init__.py +++ b/torchbenchmark/__init__.py @@ -42,7 +42,7 @@ def __exit__(self, exc_type, exc_value, traceback): pass with add_path(str(REPO_PATH)): - from utils import TORCH_DEPS, get_pkg_versions, proxy_suggestion + from utils import TORCH_DEPS, get_pkg_versions this_dir = pathlib.Path(__file__).parent.absolute() model_dir = 'models' @@ -50,15 +50,6 @@ def __exit__(self, exc_type, exc_value, traceback): canary_model_dir = "canary_models" install_file = 'install.py' - -def _test_https(test_url: str = 'https://github.com', timeout: float = 0.5) -> bool: - try: - request.urlopen(test_url, timeout=timeout) - except OSError: - return False - return True - - def _install_deps(model_path: str, verbose: bool = True) -> Tuple[bool, Any]: from .util.env_check import get_pkg_versions run_args = [ @@ -135,10 +126,6 @@ def _is_canary_model(model_name: str) -> bool: return False def setup(models: List[str] = [], verbose: bool = True, continue_on_fail: bool = False, test_mode: bool = False, allow_canary: bool = False) -> bool: - if not _test_https(): - print(proxy_suggestion) - sys.exit(-1) - failures = {} models = list(map(lambda p: p.lower(), models)) model_paths = filter(lambda p: True if not models else os.path.basename(p).lower() in models, _list_model_paths()) diff --git a/utils/__init__.py b/utils/__init__.py index 51bfcc9d58..42e1be2c96 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -5,10 +5,6 @@ TORCH_DEPS = ['torch', 'torchvision', 'torchaudio'] -proxy_suggestion = "Unable to verify https connectivity, " \ - "required for setup.\n" \ - "Do you need to use a proxy?" - class add_path(): def __init__(self, path): self.path = path @@ -30,10 +26,3 @@ def get_pkg_versions(packages: List[str], reload: bool=False) -> Dict[str, str]: module = importlib.reload(module) versions[module.__name__] = module.__version__ return versions - -def _test_https(test_url: str = 'https://github.com', timeout: float = 0.5) -> bool: - try: - request.urlopen(test_url, timeout=timeout) - except OSError: - return False - return True