Spaces:
Running
Running
add demo
Browse files- app.py +1 -0
- modeling_florence2.py +3 -3
app.py
CHANGED
@@ -4,6 +4,7 @@ from PIL import Image
|
|
4 |
import requests
|
5 |
from transformers import AutoProcessor
|
6 |
from modeling_florence2 import Florence2ForConditionalGeneration
|
|
|
7 |
|
8 |
# Initialize model and processor
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
4 |
import requests
|
5 |
from transformers import AutoProcessor
|
6 |
from modeling_florence2 import Florence2ForConditionalGeneration
|
7 |
+
from configuration_florence2 import Florence2Config
|
8 |
|
9 |
# Initialize model and processor
|
10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
modeling_florence2.py
CHANGED
@@ -39,9 +39,9 @@ from transformers.utils import (
|
|
39 |
is_flash_attn_2_available,
|
40 |
is_flash_attn_greater_or_equal_2_10,
|
41 |
)
|
42 |
-
from
|
43 |
-
from
|
44 |
-
from
|
45 |
|
46 |
|
47 |
from transformers.activations import ACT2FN
|
|
|
39 |
is_flash_attn_2_available,
|
40 |
is_flash_attn_greater_or_equal_2_10,
|
41 |
)
|
42 |
+
from configuration_florence2 import Florence2Config
|
43 |
+
from configuration_florence2 import Florence2LanguageConfig
|
44 |
+
from configuration_florence2 import Florence2VisionConfig
|
45 |
|
46 |
|
47 |
from transformers.activations import ACT2FN
|