Oleg Shulyakov commited on
Commit
3ca6cef
·
1 Parent(s): ae43339

Shell: update donwload command

Browse files
Files changed (1) hide show
  1. hf-quantize.sh +6 -16
hf-quantize.sh CHANGED
@@ -99,8 +99,8 @@ if [ -f "$FP16_MODEL_PATH" ]; then
99
  else
100
  # --- Step 1: Check Hugging Face Login ---
101
  echo "Checking Hugging Face login status..."
102
- if ! huggingface-cli whoami > /dev/null 2>&1; then
103
- echo "Error: Not logged into Hugging Face. Please run 'huggingface-cli login' first."
104
  exit 1
105
  fi
106
  echo "Logged in successfully."
@@ -110,25 +110,15 @@ else
110
  MODEL_DOWNLOAD_DIR="./downloads/$MODEL_NAME"
111
  mkdir -p "$MODEL_DOWNLOAD_DIR"
112
 
113
- # Determine if safetensors or bin files exist
114
- echo "Checking for safetensors files..."
115
- if huggingface-cli repo-files "$MODEL_ID" | grep -q '\.safetensors$'; then
116
- PATTERN="*.safetensors"
117
- echo "Found safetensors files. Downloading with pattern: $PATTERN"
118
- else
119
- PATTERN="*.bin"
120
- echo "No safetensors files found. Downloading with pattern: $PATTERN"
121
- fi
122
-
123
  # Download necessary files
124
- huggingface-cli download "$MODEL_ID" \
125
  --revision main \
126
  --include "*.md" \
127
  --include "*.json" \
128
  --include "*.model" \
129
- --include "$PATTERN" \
130
- --local-dir "$MODEL_DOWNLOAD_DIR" \
131
- --local-dir-use-symlinks False
132
 
133
  if [ $? -ne 0 ]; then
134
  echo "Error: Failed to download model '$MODEL_ID'."
 
99
  else
100
  # --- Step 1: Check Hugging Face Login ---
101
  echo "Checking Hugging Face login status..."
102
+ if ! hf auth whoami > /dev/null 2>&1; then
103
+ echo "Error: Not logged into Hugging Face. Please run 'hf auth login' first."
104
  exit 1
105
  fi
106
  echo "Logged in successfully."
 
110
  MODEL_DOWNLOAD_DIR="./downloads/$MODEL_NAME"
111
  mkdir -p "$MODEL_DOWNLOAD_DIR"
112
 
 
 
 
 
 
 
 
 
 
 
113
  # Download necessary files
114
+ hf download "$MODEL_ID" \
115
  --revision main \
116
  --include "*.md" \
117
  --include "*.json" \
118
  --include "*.model" \
119
+ --include "*.safetensors" \
120
+ --include "*.bin" \
121
+ --local-dir "$MODEL_DOWNLOAD_DIR"
122
 
123
  if [ $? -ne 0 ]; then
124
  echo "Error: Failed to download model '$MODEL_ID'."