Spaces:
Sleeping
Sleeping
Refactor app.py and update dependencies
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import (
|
|
4 |
)
|
5 |
from transformers import (
|
6 |
AutoProcessor,
|
7 |
-
BitsAndBytesConfig,
|
8 |
LlavaForConditionalGeneration,
|
9 |
)
|
10 |
from PIL import Image
|
@@ -38,12 +38,12 @@ USER_ID = None
|
|
38 |
model_id = "blanchon/PixDiet-pixtral-nutrition-v2"
|
39 |
|
40 |
# BitsAndBytesConfig int-4 config
|
41 |
-
bnb_config = BitsAndBytesConfig(
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
)
|
47 |
|
48 |
# Modify the model and processor initialization
|
49 |
if TESTING:
|
|
|
4 |
)
|
5 |
from transformers import (
|
6 |
AutoProcessor,
|
7 |
+
# BitsAndBytesConfig,
|
8 |
LlavaForConditionalGeneration,
|
9 |
)
|
10 |
from PIL import Image
|
|
|
38 |
model_id = "blanchon/PixDiet-pixtral-nutrition-v2"
|
39 |
|
40 |
# BitsAndBytesConfig int-4 config
|
41 |
+
# bnb_config = BitsAndBytesConfig(
|
42 |
+
# load_in_4bit=True,
|
43 |
+
# bnb_4bit_use_double_quant=True,
|
44 |
+
# bnb_4bit_quant_type="nf4",
|
45 |
+
# bnb_4bit_compute_dtype=torch.bfloat16,
|
46 |
+
# )
|
47 |
|
48 |
# Modify the model and processor initialization
|
49 |
if TESTING:
|