From 08ca83c87a15bfee63da7fe2ad58e30bbbf05b26 Mon Sep 17 00:00:00 2001 From: Onkar Chougule <168134249+ochougul@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:19:18 +0530 Subject: [PATCH] Remove `index_url` dependency and extend python version compatibility (#139) * updated Readme Signed-off-by: Onkar Chougule * extended python version compatibility Signed-off-by: Onkar Chougule * extended python version compatibility Signed-off-by: Onkar Chougule * restricted python version 3.8-3.10 Signed-off-by: Onkar Chougule --------- Signed-off-by: Onkar Chougule --- README.md | 6 +++--- pyproject.toml | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 274f78968..4f22ce3fa 100644 --- a/README.md +++ b/README.md @@ -53,19 +53,19 @@ For other models, there is comprehensive documentation to inspire upon the chang ## Quick Installation ```bash -# Create Python virtual env and activate it. (Required Python 3.8) +# Create Python virtual env and activate it. (Recommended Python 3.8) python3.8 -m venv qeff_env source qeff_env/bin/activate pip install -U pip # Clone and Install the QEfficient Repo. -pip install git+https://github.com/quic/efficient-transformers --extra-index-url https://download.pytorch.org/whl/cpu +pip install git+https://github.com/quic/efficient-transformers # Or build wheel package using the below command. pip install build wheel python -m build --wheel --outdir dist -pip install dist/QEfficient-0.0.1.dev0-py3-none-any.whl --extra-index-url https://download.pytorch.org/whl/cpu +pip install dist/QEfficient-0.0.1.dev0-py3-none-any.whl ``` diff --git a/pyproject.toml b/pyproject.toml index 61f72a64b..9f5952f2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,10 +17,9 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Topic :: Scientific/Engineering :: Artificial Intelligence for Inference Accelerator", ] -requires-python = "==3.8.*" +requires-python = ">=3.8,<3.11" dependencies = [ "transformers==4.44.2", - "torch==2.0.0+cpu", "peft==0.12.0", "datasets==2.7.0", "fsspec==2023.6.0", @@ -33,6 +32,11 @@ dependencies = [ "protobuf==3.20.2", "onnxscript==0.1.0.dev20240327", "sympy", + "torch==2.0.0; platform_machine=='aarch64'", + # Specifying torch cpu package URL per python version, update the list once pytorch releases whl for python>3.11 + "torch@https://download.pytorch.org/whl/cpu/torch-2.0.0%2Bcpu-cp38-cp38-linux_x86_64.whl ; python_version=='3.8' and platform_machine=='x86_64'", + "torch@https://download.pytorch.org/whl/cpu/torch-2.0.0%2Bcpu-cp39-cp39-linux_x86_64.whl ; python_version=='3.9' and platform_machine=='x86_64'", + "torch@https://download.pytorch.org/whl/cpu/torch-2.0.0%2Bcpu-cp310-cp310-linux_x86_64.whl ; python_version=='3.10' and platform_machine=='x86_64'", ] [project.optional-dependencies]