Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,6 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
import random
|
4 |
from PIL import Image
|
5 |
-
import modeling_florence2
|
6 |
-
modeling_florence2.DaViT._initialize_weights = lambda self, module=None: None
|
7 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
8 |
from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
|
9 |
|
@@ -12,6 +10,7 @@ REVISION = "ceaf371f01ef66192264811b390bccad475a4f02"
|
|
12 |
# Florence-2 로드
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', revision = REVISION, trust_remote_code=True, ignore_mismatched_sizes=True, ).to(device).eval()
|
|
|
15 |
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-base', revision = REVISION, trust_remote_code=True)
|
16 |
|
17 |
# Stable Diffusion TurboX 로드
|
|
|
2 |
import torch
|
3 |
import random
|
4 |
from PIL import Image
|
|
|
|
|
5 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
6 |
from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
|
7 |
|
|
|
10 |
# Florence-2 로드
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', revision = REVISION, trust_remote_code=True, ignore_mismatched_sizes=True, ).to(device).eval()
|
13 |
+
florence_model.DaViT._initialize_weights = lambda self, module=None: None
|
14 |
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-base', revision = REVISION, trust_remote_code=True)
|
15 |
|
16 |
# Stable Diffusion TurboX 로드
|