diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index a15cca96..0c8db252 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -44,5 +44,4 @@ jobs: -v ./tests:${{ env.CACHE_TEST_DIR }} \ --entrypoint /bin/bash \ integration-test-pytorch:gpu \ - -c "pip install '.[test, st, diffusers]' && pytest ${{ env.CACHE_TEST_DIR }}/unit" - \ No newline at end of file + -c "pip install '.[test,st,diffusers,google]' && pytest ${{ env.CACHE_TEST_DIR }}/unit" diff --git a/dockerfiles/pytorch/Dockerfile b/dockerfiles/pytorch/Dockerfile index 348ef232..324001df 100644 --- a/dockerfiles/pytorch/Dockerfile +++ b/dockerfiles/pytorch/Dockerfile @@ -14,29 +14,30 @@ RUN apt-get update && \ add-apt-repository ppa:deadsnakes/ppa && \ apt-get -y upgrade --only-upgrade systemd openssl cryptsetup && \ apt-get install -y \ - build-essential \ - bzip2 \ - curl \ - git \ - git-lfs \ - tar \ - gcc \ - g++ \ - cmake \ - libprotobuf-dev \ - protobuf-compiler \ - python3-dev \ - python3-pip \ - python3.11 \ - libsndfile1-dev \ - ffmpeg \ + build-essential \ + bzip2 \ + curl \ + git \ + git-lfs \ + tar \ + gcc \ + g++ \ + cmake \ + libprotobuf-dev \ + protobuf-compiler \ + python3-dev \ + python3-pip \ + python3.11 \ + libsndfile1-dev \ + ffmpeg \ && apt-get clean autoremove --yes \ && rm -rf /var/lib/{apt,dpkg,cache,log} + # Copying only necessary files as filtered by .dockerignore COPY . . # install wheel and setuptools -RUN pip install --no-cache-dir -U pip ".[torch, st, diffusers]" +RUN pip install --no-cache-dir --upgrade pip ".[torch,st,diffusers]" # copy application COPY src/huggingface_inference_toolkit huggingface_inference_toolkit @@ -47,8 +48,7 @@ COPY --chmod=0755 scripts/entrypoint.sh entrypoint.sh ENTRYPOINT ["bash", "-c", "./entrypoint.sh"] +FROM base AS vertex -from base as vertex - -# Install Vertex AI requiremented packages -RUN pip install --no-cache-dir google-cloud-storage \ No newline at end of file +# Install `google` extra for Vertex AI compatibility +RUN pip install --no-cache-dir --upgrade ".[google]" diff --git a/setup.cfg b/setup.cfg index 21085086..79d6ce9b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,4 +19,4 @@ use_parentheses = True [flake8] ignore = E203, E501, E741, W503, W605 -max-line-length = 119 \ No newline at end of file +max-line-length = 119 diff --git a/setup.py b/setup.py index a199a4d3..7068f7a6 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from __future__ import absolute_import + from setuptools import find_packages, setup # We don't declare our dependency on transformers here because we build with @@ -12,7 +13,7 @@ # libavcodec-extra : libavcodec-extra inculdes additional codecs for ffmpeg install_requires = [ - "transformers[sklearn,sentencepiece, audio,vision]==4.41.1", + "transformers[sklearn,sentencepiece,audio,vision]==4.41.1", "orjson", # vision "Pillow", @@ -25,7 +26,7 @@ "starlette", "uvicorn", "pandas", - "peft==0.11.1" + "peft==0.11.1", ] extras = {} @@ -43,26 +44,26 @@ "mock==2.0.0", "docker", "requests", - "tenacity" -] -extras["quality"] = [ - "isort", - "ruff" + "tenacity", ] +extras["quality"] = ["isort", "ruff"] extras["inf2"] = ["optimum-neuron"] +extras["google"] = ["google-cloud-storage"] setup( name="huggingface-inference-toolkit", version=VERSION, author="HuggingFace", - description=".", + description="Hugging Face Inference Toolkit is for serving 🤗 Transformers models in containers.", url="", package_dir={"": "src"}, packages=find_packages(where="src"), install_requires=install_requires, extras_require=extras, - entry_points={"console_scripts": "serve=sagemaker_huggingface_inference_toolkit.serving:main"}, - python_requires=">=3.8.0", + entry_points={ + "console_scripts": "serve=sagemaker_huggingface_inference_toolkit.serving:main" + }, + python_requires=">=3.8", license="Apache License 2.0", classifiers=[ "Development Status :: 5 - Production/Stable", @@ -72,7 +73,11 @@ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Artificial Intelligence", ], )