Skip to content

Commit

Permalink
deps(conda): use transformers-env with vllm,exllama(2) (#1554)
Browse files Browse the repository at this point in the history
* deps(conda): use transformers with vllm

* join vllm, exllama, exllama2, split petals
  • Loading branch information
mudler authored Jan 6, 2024
1 parent ce724a7 commit 949da77
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 131 deletions.
14 changes: 7 additions & 7 deletions backend/python/common-env/transformers/transformers-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies:
- fsspec==2023.6.0
- funcy==2.0
- grpcio==1.59.0
- huggingface-hub==0.16.4
- huggingface-hub
- idna==3.4
- jinja2==3.1.2
- jmespath==1.0.1
Expand All @@ -70,7 +70,6 @@ dependencies:
- packaging==23.2
- pandas
- peft==0.5.0
- git+https://github.com/bigscience-workshop/petals
- protobuf==4.24.4
- psutil==5.9.5
- pyarrow==13.0.0
Expand All @@ -85,12 +84,10 @@ dependencies:
- scipy==1.11.3
- six==1.16.0
- sympy==1.12
- tokenizers==0.14.0
- torch==2.1.0
- torchaudio==2.1.0
- tokenizers
- torch==2.1.2
- torchaudio==2.1.2
- tqdm==4.66.1
- transformers==4.34.0
- TTS==0.22.0
- triton==2.1.0
- typing-extensions==4.8.0
- tzdata==2023.3
Expand All @@ -114,4 +111,7 @@ dependencies:
- sudachipy
- sudachidict_core
- vocos
- vllm==0.2.7
- transformers>=4.36.0 # Required for Mixtral.
- xformers==0.0.23.post1
prefix: /opt/conda/envs/transformers
13 changes: 7 additions & 6 deletions backend/python/common-env/transformers/transformers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies:
- fsspec==2023.6.0
- funcy==2.0
- grpcio==1.59.0
- huggingface-hub==0.16.4
- huggingface-hub
- idna==3.4
- jinja2==3.1.2
- jmespath==1.0.1
Expand All @@ -59,7 +59,6 @@ dependencies:
- packaging==23.2
- pandas
- peft==0.5.0
- git+https://github.com/bigscience-workshop/petals
- protobuf==4.24.4
- psutil==5.9.5
- pyarrow==13.0.0
Expand All @@ -74,11 +73,10 @@ dependencies:
- scipy==1.11.3
- six==1.16.0
- sympy==1.12
- tokenizers==0.14.0
- torch==2.1.0
- torchaudio==2.1.0
- tokenizers
- torch==2.1.2
- torchaudio==2.1.2
- tqdm==4.66.1
- transformers==4.34.0
- triton==2.1.0
- typing-extensions==4.8.0
- tzdata==2023.3
Expand All @@ -102,4 +100,7 @@ dependencies:
- sudachipy
- sudachidict_core
- vocos
- vllm==0.2.7
- transformers>=4.36.0 # Required for Mixtral.
- xformers==0.0.23.post1
prefix: /opt/conda/envs/transformers
4 changes: 1 addition & 3 deletions backend/python/exllama/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.PHONY: exllama
exllama:
@echo "Creating virtual environment..."
@conda env create --name exllama --file exllama.yml
@echo "Virtual environment created."
$(MAKE) -C ../common-env/transformers
bash install.sh

.PHONY: run
Expand Down
2 changes: 1 addition & 1 deletion backend/python/exllama/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export PATH=$PATH:/opt/conda/bin

# Activate conda environment
source activate exllama
source activate transformers

echo $CONDA_PREFIX

Expand Down
2 changes: 1 addition & 1 deletion backend/python/exllama/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export PATH=$PATH:/opt/conda/bin

# Activate conda environment
source activate exllama
source activate transformers

# get the directory where the bash script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
4 changes: 1 addition & 3 deletions backend/python/exllama2/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.PHONY: exllama2
exllama2:
@echo "Creating virtual environment..."
@conda env create --name exllama2 --file exllama2.yml
@echo "Virtual environment created."
$(MAKE) -C ../common-env/transformers
bash install.sh

.PHONY: run
Expand Down
2 changes: 1 addition & 1 deletion backend/python/exllama2/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export PATH=$PATH:/opt/conda/bin

# Activate conda environment
source activate exllama2
source activate transformers

echo $CONDA_PREFIX

Expand Down
2 changes: 1 addition & 1 deletion backend/python/exllama2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export PATH=$PATH:/opt/conda/bin

# Activate conda environment
source activate exllama2
source activate transformers

# get the directory where the bash script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
4 changes: 3 additions & 1 deletion backend/python/petals/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.PHONY: petals
petals:
$(MAKE) -C ../common-env/transformers
@echo "Creating virtual environment..."
@conda env create --name petals --file petals.yml
@echo "Virtual environment created."

.PHONY: run
run:
Expand Down
6 changes: 4 additions & 2 deletions backend/python/petals/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

export PATH=$PATH:/opt/conda/bin

CONDA_ENV=petals

# Activate conda environment
# if source is available use it, or use conda
#
if [ -f /opt/conda/bin/activate ]; then
source activate transformers
source activate $CONDA_ENV
else
eval "$(conda shell.bash hook)"
conda activate transformers
conda activate $CONDA_ENV
fi

# get the directory where the bash script is located
Expand Down
11 changes: 10 additions & 1 deletion backend/python/petals/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
## A bash script wrapper that runs the transformers server with conda

# Activate conda environment
source activate transformers
CONDA_ENV=petals
# Activate conda environment
# if source is available use it, or use conda
#
if [ -f /opt/conda/bin/activate ]; then
source activate $CONDA_ENV
else
eval "$(conda shell.bash hook)"
conda activate $CONDA_ENV
fi

# get the directory where the bash script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
4 changes: 1 addition & 3 deletions backend/python/vllm/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.PHONY: vllm
vllm:
@echo "Creating virtual environment..."
@conda env create --name vllm --file vllm.yml
@echo "Virtual environment created."
$(MAKE) -C ../common-env/transformers

.PHONY: run
run:
Expand Down
2 changes: 1 addition & 1 deletion backend/python/vllm/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export PATH=$PATH:/opt/conda/bin

# Activate conda environment
source activate vllm
source activate transformers

# get the directory where the bash script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
2 changes: 1 addition & 1 deletion backend/python/vllm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## A bash script wrapper that runs the transformers server with conda

# Activate conda environment
source activate vllm
source activate transformers

# get the directory where the bash script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
99 changes: 0 additions & 99 deletions backend/python/vllm/vllm.yml

This file was deleted.

0 comments on commit 949da77

Please sign in to comment.