Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import AutoProcessor, Idefics2ForConditionalGeneration
|
| 3 |
import subprocess
|
| 4 |
import torch
|
| 5 |
from peft import LoraConfig
|
|
@@ -16,7 +16,9 @@ bnb_config = BitsAndBytesConfig(
|
|
| 16 |
bnb_4bit_quant_type="nf4",
|
| 17 |
bnb_4bit_compute_dtype=torch.float16
|
| 18 |
)
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# if USE_QLORA or USE_LORA:
|
| 22 |
# lora_config = LoraConfig(
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import AutoProcessor, Idefics2ForConditionalGeneration, AutoModelForPreTraining
|
| 3 |
import subprocess
|
| 4 |
import torch
|
| 5 |
from peft import LoraConfig
|
|
|
|
| 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",quantization_config=bnb_config)
|
| 22 |
|
| 23 |
# if USE_QLORA or USE_LORA:
|
| 24 |
# lora_config = LoraConfig(
|