Update handler.py
Browse files- handler.py +3 -0
handler.py
CHANGED
|
@@ -2,10 +2,13 @@ import torch
|
|
| 2 |
import sys
|
| 3 |
from subprocess import run
|
| 4 |
from PIL import Image
|
|
|
|
|
|
|
| 5 |
|
| 6 |
#run("pip install flash-attn --no-build-isolation", shell=True, check=True)
|
| 7 |
run("pip install -U bitsandbytes", shell=True, check=True)
|
| 8 |
|
|
|
|
| 9 |
from transformers import AutoModelForVision2Seq, AutoProcessor, BitsAndBytesConfig
|
| 10 |
|
| 11 |
model_id = "ibm-granite/granite-vision-3.2-2b"
|
|
|
|
| 2 |
import sys
|
| 3 |
from subprocess import run
|
| 4 |
from PIL import Image
|
| 5 |
+
import os
|
| 6 |
+
import signal
|
| 7 |
|
| 8 |
#run("pip install flash-attn --no-build-isolation", shell=True, check=True)
|
| 9 |
run("pip install -U bitsandbytes", shell=True, check=True)
|
| 10 |
|
| 11 |
+
os.kill(os.getpid(), signal.SIGKILL)
|
| 12 |
from transformers import AutoModelForVision2Seq, AutoProcessor, BitsAndBytesConfig
|
| 13 |
|
| 14 |
model_id = "ibm-granite/granite-vision-3.2-2b"
|