Skip to content
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

fix vLLM example (make dirs) #455

Merged
merged 1 commit into from
Sep 24, 2023
Merged
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
8 changes: 5 additions & 3 deletions 06_gpu_and_ml/vllm_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

from modal import Image, Secret, Stub, method

MODEL_DIR = "/model"


# ## Define a container image
#
Expand All @@ -45,15 +47,15 @@
def download_model_to_folder():
from huggingface_hub import snapshot_download

os.makedirs(MODEL_DIR, exist_ok=True)

snapshot_download(
"meta-llama/Llama-2-13b-chat-hf",
local_dir="/model",
local_dir=MODEL_DIR,
token=os.environ["HUGGINGFACE_TOKEN"],
)


MODEL_DIR = "/model"

# ### Image definition
# We’ll start from a Dockerhub image recommended by `vLLM`, upgrade the older
# version of `torch` to a new one specifically built for CUDA 11.8. Next, we install `vLLM` from source to get the latest updates.
Expand Down