Blip: Deprecate BlipModel (#31235)
* deprecate blip * mention deprecation on docs
This commit is contained in:
@@ -66,6 +66,8 @@ The original code can be found [here](https://github.com/salesforce/BLIP).
|
|||||||
|
|
||||||
## BlipModel
|
## BlipModel
|
||||||
|
|
||||||
|
`BlipModel` is going to be deprecated in future versions, please use `BlipForConditionalGeneration`, `BlipForImageTextRetrieval` or `BlipForQuestionAnswering` depending on your usecase.
|
||||||
|
|
||||||
[[autodoc]] BlipModel
|
[[autodoc]] BlipModel
|
||||||
- forward
|
- forward
|
||||||
- get_text_features
|
- get_text_features
|
||||||
|
|||||||
@@ -742,7 +742,12 @@ class BlipVisionModel(BlipPreTrainedModel):
|
|||||||
return self.embeddings
|
return self.embeddings
|
||||||
|
|
||||||
|
|
||||||
@add_start_docstrings(BLIP_START_DOCSTRING)
|
@add_start_docstrings(
|
||||||
|
"""
|
||||||
|
This model is going to be deprecated in future versions. Please use `BlipForConditionalGeneration`, `BlipForQuestionAnswering` or `BlipForImageTextRetrieval` depending on your usecase.
|
||||||
|
""",
|
||||||
|
BLIP_START_DOCSTRING,
|
||||||
|
)
|
||||||
class BlipModel(BlipPreTrainedModel):
|
class BlipModel(BlipPreTrainedModel):
|
||||||
config_class = BlipConfig
|
config_class = BlipConfig
|
||||||
|
|
||||||
@@ -775,6 +780,10 @@ class BlipModel(BlipPreTrainedModel):
|
|||||||
self.text_projection = nn.Linear(self.text_embed_dim, self.projection_dim, bias=False)
|
self.text_projection = nn.Linear(self.text_embed_dim, self.projection_dim, bias=False)
|
||||||
self.logit_scale = nn.Parameter(torch.tensor(self.config.logit_scale_init_value))
|
self.logit_scale = nn.Parameter(torch.tensor(self.config.logit_scale_init_value))
|
||||||
|
|
||||||
|
logger.warning(
|
||||||
|
"`BlipModel` is going to be deprecated in future release, please use `BlipForConditionalGeneration`, `BlipForQuestionAnswering` or `BlipForImageTextRetrieval` depending on your usecase."
|
||||||
|
)
|
||||||
|
|
||||||
# Initialize weights and apply final processing
|
# Initialize weights and apply final processing
|
||||||
self.post_init()
|
self.post_init()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user