Skip to content

Commit

Permalink
feat: add cpu optional deps (#43)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy authored May 26, 2023
1 parent ef5d369 commit 8e95e34
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN mkdir -p /workspace

COPY . workspace/
WORKDIR /workspace
RUN pip install -e .
RUN pip install -e .[cpu]

RUN modelz-llm --dry-run

Expand Down
2 changes: 1 addition & 1 deletion images/chatglm-6b/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN mkdir -p /workspace

COPY . workspace/
WORKDIR /workspace
RUN pip install -e .
RUN pip install -e .[cpu]

# RUN modelz-llm --dry-run --model THUDM/chatglm-6b

Expand Down
2 changes: 1 addition & 1 deletion images/fastchat-t5-3b/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN mkdir -p /workspace

COPY . workspace/
WORKDIR /workspace
RUN pip install -e .
RUN pip install -e .[cpu]

RUN modelz-llm --dry-run --model lmsys/fastchat-t5-3b-v1.0

Expand Down
2 changes: 1 addition & 1 deletion images/llama-7b/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN mkdir -p /workspace

COPY . workspace/
WORKDIR /workspace
RUN pip install -e .
RUN pip install -e .[cpu]

# RUN modelz-llm --dry-run --model decapoda-research/llama-7b-hf

Expand Down
2 changes: 1 addition & 1 deletion images/vicuna-7b/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN mkdir -p /workspace

COPY . workspace/
WORKDIR /workspace
RUN pip install -e .
RUN pip install -e .[cpu]

# RUN modelz-llm --dry-run --model lmsys/vicuna-7b-delta-v1.1

Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ dependencies = [
]
[project.optional-dependencies]
cpu = [
"torch --extra-index-url https://download.pytorch.org/whl/cpu",
# only include torch CPU for Linux x86_64
"torch @ https://download.pytorch.org/whl/cpu/torch-2.0.1%2Bcpu-cp39-cp39-linux_x86_64.whl ; python_version == '3.9'",
"torch @ https://download.pytorch.org/whl/cpu/torch-2.0.1%2Bcpu-cp310-cp310-linux_x86_64.whl ; python_version == '3.10'",
"torch @ https://download.pytorch.org/whl/cpu/torch-2.0.1%2Bcpu-cp311-cp311-linux_x86_64.whl ; python_version == '3.11'",
"transformers",
"sentencepiece",
"accelerate",
]
gpu = [
"torch --extra-index-url https://download.pytorch.org/whl/cu116",
"torch", # CUDA 11.7, ref https://pytorch.org/get-started/locally/
"transformers",
"sentencepiece",
"accelerate",
Expand Down

0 comments on commit 8e95e34

Please sign in to comment.