Spaces:
Runtime error
Runtime error
Update utils/florencegpu2.py
Browse files- utils/florencegpu2.py +3 -2
utils/florencegpu2.py
CHANGED
@@ -7,7 +7,8 @@ from PIL import Image
|
|
7 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
8 |
from transformers.dynamic_module_utils import get_imports
|
9 |
|
10 |
-
FLORENCE_CHECKPOINT = "microsoft/Florence-2-
|
|
|
11 |
FLORENCE_OBJECT_DETECTION_TASK = '<OD>'
|
12 |
FLORENCE_DETAILED_CAPTION_TASK = '<MORE_DETAILED_CAPTION>'
|
13 |
FLORENCE_CAPTION_TO_PHRASE_GROUNDING_TASK = '<CAPTION_TO_PHRASE_GROUNDING>'
|
@@ -54,4 +55,4 @@ def run_florence_inference(
|
|
54 |
generated_ids, skip_special_tokens=False)[0]
|
55 |
response = processor.post_process_generation(
|
56 |
generated_text, task=task, image_size=image.size)
|
57 |
-
return generated_text, response
|
|
|
7 |
from transformers import AutoModelForCausalLM, AutoProcessor
|
8 |
from transformers.dynamic_module_utils import get_imports
|
9 |
|
10 |
+
FLORENCE_CHECKPOINT = "microsoft/Florence-2-large"
|
11 |
+
#FLORENCE_CHECKPOINT = "microsoft/Florence-2-large-ft"
|
12 |
FLORENCE_OBJECT_DETECTION_TASK = '<OD>'
|
13 |
FLORENCE_DETAILED_CAPTION_TASK = '<MORE_DETAILED_CAPTION>'
|
14 |
FLORENCE_CAPTION_TO_PHRASE_GROUNDING_TASK = '<CAPTION_TO_PHRASE_GROUNDING>'
|
|
|
55 |
generated_ids, skip_special_tokens=False)[0]
|
56 |
response = processor.post_process_generation(
|
57 |
generated_text, task=task, image_size=image.size)
|
58 |
+
return generated_text, response
|