Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,14 +11,14 @@ USE_LORA = False
|
|
| 11 |
USE_QLORA = True
|
| 12 |
|
| 13 |
processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics2-8b", do_image_splitting=False)
|
| 14 |
-
bnb_config = BitsAndBytesConfig(
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
model = AutoModelForPreTraining.from_pretrained("HuggingFaceM4/idefics2-8b",quantization_config=bnb_config)
|
| 21 |
-
|
| 22 |
|
| 23 |
# if USE_QLORA or USE_LORA:
|
| 24 |
# lora_config = LoraConfig(
|
|
|
|
| 11 |
USE_QLORA = True
|
| 12 |
|
| 13 |
processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics2-8b", do_image_splitting=False)
|
| 14 |
+
# bnb_config = BitsAndBytesConfig(
|
| 15 |
+
# load_in_4bit=True,
|
| 16 |
+
# bnb_4bit_quant_type="nf4",
|
| 17 |
+
# bnb_4bit_compute_dtype=torch.float16
|
| 18 |
+
# )
|
| 19 |
|
| 20 |
+
# model = AutoModelForPreTraining.from_pretrained("HuggingFaceM4/idefics2-8b",quantization_config=bnb_config)
|
| 21 |
+
model = Idefics2ForConditionalGeneration.from_pretrained("HuggingFaceM4/idefics2-8b",load_in_4bit=True)
|
| 22 |
|
| 23 |
# if USE_QLORA or USE_LORA:
|
| 24 |
# lora_config = LoraConfig(
|