Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import warnings
|
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
-
from transformers import AutoProcessor,
|
6 |
from diffusers import AutoPipelineForImage2Image
|
7 |
import random
|
8 |
import numpy as np
|
@@ -31,7 +31,7 @@ pipe = AutoPipelineForImage2Image.from_pretrained(
|
|
31 |
pipe.enable_vae_tiling() # To help with memory for large images
|
32 |
|
33 |
# Initialize Florence model with float32 to avoid dtype mismatch
|
34 |
-
florence_model =
|
35 |
'microsoft/Florence-2-large',
|
36 |
trust_remote_code=True,
|
37 |
torch_dtype=torch.float32
|
|
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
+
from transformers import AutoProcessor, AutoModelForCausalLM
|
6 |
from diffusers import AutoPipelineForImage2Image
|
7 |
import random
|
8 |
import numpy as np
|
|
|
31 |
pipe.enable_vae_tiling() # To help with memory for large images
|
32 |
|
33 |
# Initialize Florence model with float32 to avoid dtype mismatch
|
34 |
+
florence_model = AutoModelForCausalLM.from_pretrained(
|
35 |
'microsoft/Florence-2-large',
|
36 |
trust_remote_code=True,
|
37 |
torch_dtype=torch.float32
|