Update README.md
Browse files
README.md
CHANGED
@@ -24,7 +24,7 @@ This model is recommended to work with **TFT-ID-1.0**[[HF]](https://huggingface.
|
|
24 |
# check out https://huggingface.co/microsoft/Phi-3.5-vision-instruct for more details
|
25 |
|
26 |
import torch
|
27 |
-
from transformers import AutoModelForCausalLM, AutoProcessor
|
28 |
from PIL import Image
|
29 |
import requests
|
30 |
|
@@ -38,7 +38,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
38 |
trust_remote_code=True,
|
39 |
torch_dtype="auto",
|
40 |
_attn_implementation='flash_attention_2',
|
41 |
-
load_in_4bit=True # Optional: Load model in 4-bit mode to save memory
|
42 |
)
|
43 |
|
44 |
processor = AutoProcessor.from_pretrained(model_id,
|
|
|
24 |
# check out https://huggingface.co/microsoft/Phi-3.5-vision-instruct for more details
|
25 |
|
26 |
import torch
|
27 |
+
from transformers import AutoModelForCausalLM, AutoProcessor, BitsAndBytesConfig
|
28 |
from PIL import Image
|
29 |
import requests
|
30 |
|
|
|
38 |
trust_remote_code=True,
|
39 |
torch_dtype="auto",
|
40 |
_attn_implementation='flash_attention_2',
|
41 |
+
quantization_config=BitsAndBytesConfig(load_in_4bit=True) # Optional: Load model in 4-bit mode to save memory
|
42 |
)
|
43 |
|
44 |
processor = AutoProcessor.from_pretrained(model_id,
|