Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
goliaro committed Feb 24, 2025
1 parent 2488463 commit 19b8540
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions conda/flexflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ dependencies:
- loralib
- triton
- peft
- pytest
2 changes: 1 addition & 1 deletion docker/flexflow-environment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ RUN rm /usr/local/bin/install_pytorch.sh
RUN pip3 install transformers>=4.47.1 sentencepiece einops
RUN pip3 install tensorflow notebook
# PEFT-related
RUN pip3 install scipy bitsandbytes datasets accelerate loralib triton peft
RUN pip3 install scipy bitsandbytes datasets accelerate loralib triton peft pytest
RUN pip3 install streamlit

# Install Rust
Expand Down
2 changes: 1 addition & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ if [ -f "$hf_token_path" ]; then
fi

ssh_key_volume=""
ssh_key_path="$HOME/.ssh/id_rsa"
ssh_key_path="~/.ssh/id_rsa"
if [ -f "$ssh_key_path" ] && [ -f "$ssh_key_path.pub" ]; then
ssh_key_volume="-v $ssh_key_path:/root/.ssh/id_rsa -v $ssh_key_path.pub:/root/.ssh/id_rsa.pub"
fi
Expand Down
3 changes: 2 additions & 1 deletion python/flexflow/serve/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ def download_hf_weights_if_needed(self) -> None:
If not, or if the refresh_cache parameter is set to True, download new weights and convert them.
"""

# TODO: edit this to download the weights using snapshot_download and convert them to FlexFlow format without loading them to GPU
def download_and_convert_llm_weights(model_name):
num_cores = os.cpu_count() -1 if os.cpu_count() > 1 else 1
snapshot_download(repo_id=model_name, allow_patterns="*.safetensors", max_workers=min(30, num_cores))
hf_model = AutoModelForCausalLM.from_pretrained(
model_name,
trust_remote_code=True,
Expand Down

0 comments on commit 19b8540

Please sign in to comment.