File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ if [ -n "$KV_CACHE_QUANT" ]; then
7474fi
7575
7676if [[ " ${MODEL_NAME,,} " == * " vila" * ]]; then
77+ # Save current transformers version for later restoration
78+ ORIGINAL_TRANSFORMERS_VERSION=$( pip show transformers | grep Version | cut -d' ' -f2)
79+ echo " Current transformers version: $ORIGINAL_TRANSFORMERS_VERSION "
80+
7781 # Install required dependency for VILA
7882 pip install -r ../vlm_ptq/requirements-vila.txt
7983 # Clone original VILA repo
@@ -103,6 +107,13 @@ if [[ $TASKS =~ "quant" ]] || [[ ! -d "$SAVE_PATH" ]] || [[ ! $(ls -A $SAVE_PATH
103107 fi
104108fi
105109
110+ # Restore original transformers version immediately after PTQ for VILA models
111+ if [[ " ${MODEL_NAME,,} " == * " vila" * ]] && [ -n " $ORIGINAL_TRANSFORMERS_VERSION " ]; then
112+ echo " Restoring original transformers version: $ORIGINAL_TRANSFORMERS_VERSION "
113+ pip install transformers==$ORIGINAL_TRANSFORMERS_VERSION
114+ echo " Transformers version restored successfully."
115+ fi
116+
106117if [[ " $QFORMAT " != " fp8" ]]; then
107118 echo " For quant format $QFORMAT , please refer to the TensorRT-LLM documentation for deployment. Checkpoint saved to $SAVE_PATH ."
108119 exit 0
You can’t perform that action at this time.
0 commit comments