Skip to content

Add google extra with google-cloud-storage #77

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

Merged
merged 7 commits into from
Aug 7, 2024
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
3 changes: 1 addition & 2 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

-c "pip install '.[test,st,diffusers,google]' && pytest ${{ env.CACHE_TEST_DIR }}/unit"
42 changes: 21 additions & 21 deletions dockerfiles/pytorch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
# Install `google` extra for Vertex AI compatibility
RUN pip install --no-cache-dir --upgrade ".[google]"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ use_parentheses = True

[flake8]
ignore = E203, E501, E741, W503, W605
max-line-length = 119
max-line-length = 119
25 changes: 15 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
Expand All @@ -25,7 +26,7 @@
"starlette",
"uvicorn",
"pandas",
"peft==0.11.1"
"peft==0.11.1",
]

extras = {}
Expand All @@ -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",
Expand All @@ -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",
],
)
Loading