Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,14 @@ bnb_config = BitsAndBytesConfig(
|
|
27 |
|
28 |
processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics2-8b", size= {"longest_edge": 448, "shortest_edge": 378}, do_image_splitting=False)
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
if torch.cuda.is_available():
|
31 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
32 |
"stabilityai/stable-diffusion-xl-base-1.0",
|
|
|
27 |
|
28 |
processor = AutoProcessor.from_pretrained("HuggingFaceM4/idefics2-8b", size= {"longest_edge": 448, "shortest_edge": 378}, do_image_splitting=False)
|
29 |
|
30 |
+
vpe_model = AutoModelForVision2Seq.from_pretrained(
|
31 |
+
"HuggingFaceM4/idefics2-8b",
|
32 |
+
torch_dtype=torch.float16,
|
33 |
+
quantization_config=bnb_config,
|
34 |
+
)
|
35 |
+
|
36 |
+
vpe_model = PeftModel.from_pretrained(vpe_model, "VPE2").to("cuda")
|
37 |
+
|
38 |
if torch.cuda.is_available():
|
39 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
40 |
"stabilityai/stable-diffusion-xl-base-1.0",
|