Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
6 |
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True).to(device).eval()
|
7 |
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True)
|
8 |
|
9 |
-
def generate_caption():
|
10 |
if not isinstance(image, Image.Image):
|
11 |
image = Image.fromarray(image)
|
12 |
|
|
|
6 |
florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True).to(device).eval()
|
7 |
florence_processor = AutoProcessor.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True)
|
8 |
|
9 |
+
def generate_caption(image):
|
10 |
if not isinstance(image, Image.Image):
|
11 |
image = Image.fromarray(image)
|
12 |
|