Spaces:
Running
on
L4
Running
on
L4
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def fig_to_pil(fig):
|
|
42 |
model_id='microsoft/Florence-2-large'
|
43 |
model = models[model_id]
|
44 |
processor = processors[model_id]
|
45 |
-
processor
|
46 |
|
47 |
@spaces.GPU
|
48 |
def run_example(task_prompt, image, text_input=None, model_id='microsoft/Florence-2-large'):
|
@@ -50,7 +50,7 @@ def run_example(task_prompt, image, text_input=None, model_id='microsoft/Florenc
|
|
50 |
prompt = task_prompt
|
51 |
else:
|
52 |
prompt = task_prompt + text_input
|
53 |
-
inputs = processor(text=prompt, images=image, return_tensors="pt")
|
54 |
generated_ids = model.generate(
|
55 |
input_ids=inputs["input_ids"],
|
56 |
pixel_values=inputs["pixel_values"],
|
|
|
42 |
model_id='microsoft/Florence-2-large'
|
43 |
model = models[model_id]
|
44 |
processor = processors[model_id]
|
45 |
+
processor
|
46 |
|
47 |
@spaces.GPU
|
48 |
def run_example(task_prompt, image, text_input=None, model_id='microsoft/Florence-2-large'):
|
|
|
50 |
prompt = task_prompt
|
51 |
else:
|
52 |
prompt = task_prompt + text_input
|
53 |
+
inputs = processor(text=prompt, images=image, return_tensors="pt").to("cuda")
|
54 |
generated_ids = model.generate(
|
55 |
input_ids=inputs["input_ids"],
|
56 |
pixel_values=inputs["pixel_values"],
|