Upload 3 files
Browse files- modeling_florence2.py +1 -4
modeling_florence2.py
CHANGED
@@ -2289,8 +2289,6 @@ class Florence2Seq2SeqLMOutput(ModelOutput):
|
|
2289 |
image_hidden_states of the model produced by the vision encoder
|
2290 |
"""
|
2291 |
|
2292 |
-
loss: torch.FloatTensor = None
|
2293 |
-
logits: torch.FloatTensor = None
|
2294 |
last_hidden_state: torch.FloatTensor = None
|
2295 |
past_key_values: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
|
2296 |
decoder_hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
|
@@ -2299,7 +2297,6 @@ class Florence2Seq2SeqLMOutput(ModelOutput):
|
|
2299 |
encoder_last_hidden_state: Optional[torch.FloatTensor] = None
|
2300 |
encoder_hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
|
2301 |
encoder_attentions: Optional[Tuple[torch.FloatTensor, ...]] = None
|
2302 |
-
image_hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
|
2303 |
|
2304 |
|
2305 |
FLORENCE2_START_DOCSTRING = r"""
|
@@ -2530,7 +2527,7 @@ class Florence2ForConditionalGeneration(Florence2PreTrainedModel):
|
|
2530 |
def __init__(self, config: Florence2Config):
|
2531 |
super().__init__(config)
|
2532 |
assert config.vision_config.model_type == 'davit', 'only DaViT is supported for now'
|
2533 |
-
|
2534 |
self.vision_tower = DaViT.from_config(config=config.vision_config)
|
2535 |
# remove unused layers
|
2536 |
del self.vision_tower.head
|
|
|
2289 |
image_hidden_states of the model produced by the vision encoder
|
2290 |
"""
|
2291 |
|
|
|
|
|
2292 |
last_hidden_state: torch.FloatTensor = None
|
2293 |
past_key_values: Optional[Tuple[Tuple[torch.FloatTensor]]] = None
|
2294 |
decoder_hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
|
|
|
2297 |
encoder_last_hidden_state: Optional[torch.FloatTensor] = None
|
2298 |
encoder_hidden_states: Optional[Tuple[torch.FloatTensor, ...]] = None
|
2299 |
encoder_attentions: Optional[Tuple[torch.FloatTensor, ...]] = None
|
|
|
2300 |
|
2301 |
|
2302 |
FLORENCE2_START_DOCSTRING = r"""
|
|
|
2527 |
def __init__(self, config: Florence2Config):
|
2528 |
super().__init__(config)
|
2529 |
assert config.vision_config.model_type == 'davit', 'only DaViT is supported for now'
|
2530 |
+
del config.vision_config.model_type
|
2531 |
self.vision_tower = DaViT.from_config(config=config.vision_config)
|
2532 |
# remove unused layers
|
2533 |
del self.vision_tower.head
|