Skip to content

Commit

Permalink
chore: test convert model gguf upload to hf
Browse files Browse the repository at this point in the history
  • Loading branch information
Minh141120 committed Feb 14, 2025
1 parent 78fd169 commit 27b4e2c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/convert-model-all-quant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,16 @@ jobs:
fi
for quant in "${quant_levels[@]}"; do
if [ -n "${{ env.SOURCE_MODEL_SIZE }}" ]; then
# For other branches: keep as model.gguf
# Generate the name for the main branch file
main_file_name="${{ env.MODEL_NAME }}-${quant_map[${quant}]}.gguf"
# First upload to main branch with the specific naming convention
cp "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/model.gguf" "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/${main_file_name}"
huggingface-cli upload "${{ env.USER_NAME }}/${{ env.TARGET_MODEL_ID }}" "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/${main_file_name}"
# Then upload to specific branch as model.gguf
huggingface-cli upload "${{ env.USER_NAME }}/${{ env.TARGET_MODEL_ID }}" "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/model.gguf" \
--revision "${{ env.SOURCE_MODEL_SIZE }}-gguf-${quant}"
else
# For main branch: rename file before uploading
new_name="${{ env.MODEL_NAME }}-${quant_map[${quant}]}.gguf"
mv "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/model.gguf" "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/${new_name}"
huggingface-cli upload "${{ env.USER_NAME }}/${{ env.TARGET_MODEL_ID }}" "/mnt/models/${{ env.MODEL_NAME }}/gguf/${quant}/${new_name}"
fi
done
rm -rf /mnt/models/${{ env.MODEL_NAME }}/gguf/*
Expand Down

0 comments on commit 27b4e2c

Please sign in to comment.