Update handler.py
Browse files- handler.py +3 -5
handler.py
CHANGED
|
@@ -6,18 +6,16 @@ import os
|
|
| 6 |
|
| 7 |
#run("pip install flash-attn --no-build-isolation", shell=True, check=True)
|
| 8 |
run("pip install -U bitsandbytes", shell=True, check=True)
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
os.execl(python, python, *sys.argv)
|
| 12 |
|
| 13 |
-
restart_script()
|
| 14 |
|
| 15 |
from transformers import AutoModelForVision2Seq, AutoProcessor, BitsAndBytesConfig
|
| 16 |
|
| 17 |
model_id = "ibm-granite/granite-vision-3.2-2b"
|
| 18 |
|
| 19 |
bnb_config = BitsAndBytesConfig(
|
| 20 |
-
|
| 21 |
llm_int8_skip_modules=["vision_tower", "lm_head"],
|
| 22 |
llm_int8_enable_fp32_cpu_offload=True
|
| 23 |
)
|
|
|
|
| 6 |
|
| 7 |
#run("pip install flash-attn --no-build-isolation", shell=True, check=True)
|
| 8 |
run("pip install -U bitsandbytes", shell=True, check=True)
|
| 9 |
+
run("pip install --upgrade pip", shell=True, check=True)
|
| 10 |
+
|
|
|
|
| 11 |
|
|
|
|
| 12 |
|
| 13 |
from transformers import AutoModelForVision2Seq, AutoProcessor, BitsAndBytesConfig
|
| 14 |
|
| 15 |
model_id = "ibm-granite/granite-vision-3.2-2b"
|
| 16 |
|
| 17 |
bnb_config = BitsAndBytesConfig(
|
| 18 |
+
load_in_4bit=True,
|
| 19 |
llm_int8_skip_modules=["vision_tower", "lm_head"],
|
| 20 |
llm_int8_enable_fp32_cpu_offload=True
|
| 21 |
)
|