"lib/runtime/vscode:/vscode.git/clone" did not exist on "e2a514b2ad293684889f5615913b7080aea5d333"
Unverified Commit 7b5cdc42 authored by Biswa Panda's avatar Biswa Panda Committed by GitHub
Browse files

fix: fix lora script name in docs and update setup_minio.sh script to work...

fix: fix lora script name in docs and update setup_minio.sh script to work across HF cli package versions (#5153)
parent fcddc352
...@@ -75,7 +75,7 @@ LORA_NAME="my-lora" \ ...@@ -75,7 +75,7 @@ LORA_NAME="my-lora" \
Start the Dynamo frontend and worker with LoRA support enabled: Start the Dynamo frontend and worker with LoRA support enabled:
```bash ```bash
./agg_lora_s3.sh ./agg_lora.sh
``` ```
This will: This will:
...@@ -259,7 +259,7 @@ curl -X POST http://localhost:8081/v1/loras \ ...@@ -259,7 +259,7 @@ curl -X POST http://localhost:8081/v1/loras \
### Using Different Base Models ### Using Different Base Models
To use a different base model, modify the `--model` parameter in `agg_lora_s3.sh`: To use a different base model, modify the `--model` parameter in `agg_lora.sh`:
```bash ```bash
python -m dynamo.vllm --model meta-llama/Llama-2-7b-hf --enable-lora --max-lora-rank 64 python -m dynamo.vllm --model meta-llama/Llama-2-7b-hf --enable-lora --max-lora-rank 64
...@@ -271,7 +271,7 @@ Ensure your LoRAs are compatible with the chosen base model. ...@@ -271,7 +271,7 @@ Ensure your LoRAs are compatible with the chosen base model.
### Stop Services ### Stop Services
Press `Ctrl+C` in the terminal running `agg_lora_s3.sh` to stop Dynamo services. Press `Ctrl+C` in the terminal running `agg_lora.sh` to stop Dynamo services.
### Stop MinIO ### Stop MinIO
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
set -e set -e
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Colors for output # Colors for output
GREEN='\033[0;32m' GREEN='\033[0;32m'
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
...@@ -25,6 +28,11 @@ LORA_NAME="${LORA_NAME:-codelion/Qwen3-0.6B-accuracy-recovery-lora}" ...@@ -25,6 +28,11 @@ LORA_NAME="${LORA_NAME:-codelion/Qwen3-0.6B-accuracy-recovery-lora}"
# TEMP_DIR will be created using mktemp when needed # TEMP_DIR will be created using mktemp when needed
TEMP_DIR="" TEMP_DIR=""
# HF_CLI_CMD will be set to either "hf" or "huggingface-cli" based on huggingface-hub python package version
# Starting from HF v0.34.0, the `huggingface-cli` command is deprecated in favor of `hf`.
# Please refer to https://huggingface.co/blog/hf-cli for more details.
HF_CLI_CMD=""
# Parse command line arguments # Parse command line arguments
MODE="full" MODE="full"
if [ "$1" = "--start" ]; then if [ "$1" = "--start" ]; then
...@@ -88,8 +96,15 @@ check_dependencies() { ...@@ -88,8 +96,15 @@ check_dependencies() {
exit 1 exit 1
fi fi
if ! command -v huggingface-cli &> /dev/null; then # Check for either hf or huggingface-cli
echo "Error: huggingface-cli is not installed. Install with: pip install huggingface-hub" if command -v hf &> /dev/null; then
HF_CLI_CMD="hf"
print_success "Found Hugging Face CLI: hf ($(hf version))"
elif command -v huggingface-cli &> /dev/null; then
HF_CLI_CMD="huggingface-cli"
print_success "Found Hugging Face CLI: huggingface-cli ($(huggingface-cli version))"
else
echo "Error: Neither 'hf' nor 'huggingface-cli' is installed. Install with: pip install huggingface-hub[cli]"
exit 1 exit 1
fi fi
...@@ -165,11 +180,16 @@ download_lora_from_hf() { ...@@ -165,11 +180,16 @@ download_lora_from_hf() {
# Create temporary directory using mktemp (global variable for cleanup) # Create temporary directory using mktemp (global variable for cleanup)
TEMP_DIR=$(mktemp -d -t lora_download_XXXXXX) TEMP_DIR=$(mktemp -d -t lora_download_XXXXXX)
# Download LoRA adapter files # Download LoRA adapter files using the detected CLI
print_info "Downloading adapter files..." print_info "Downloading adapter files using ${HF_CLI_CMD}..."
huggingface-cli download "${HF_LORA_REPO}" \ if [ "${HF_CLI_CMD}" = "huggingface-cli" ]; then
--local-dir "${TEMP_DIR}" \ huggingface-cli download "${HF_LORA_REPO}" \
--local-dir-use-symlinks False --local-dir "${TEMP_DIR}" \
--local-dir-use-symlinks False
else
hf download "${HF_LORA_REPO}" \
--local-dir "${TEMP_DIR}"
fi
print_success "LoRA downloaded to ${TEMP_DIR}" print_success "LoRA downloaded to ${TEMP_DIR}"
...@@ -292,7 +312,7 @@ full_setup() { ...@@ -292,7 +312,7 @@ full_setup() {
echo "" echo ""
echo "Next steps:" echo "Next steps:"
echo " 1. Run the Dynamo service with LoRA support:" echo " 1. Run the Dynamo service with LoRA support:"
echo " ./agg_lora_s3.sh" echo " ${SCRIPT_DIR}/agg_lora.sh"
echo "" echo ""
echo " 2. Load the LoRA adapter:" echo " 2. Load the LoRA adapter:"
echo " curl -X POST http://localhost:8081/v1/loras \\" echo " curl -X POST http://localhost:8081/v1/loras \\"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment