Unverified Commit 485d913d authored by Younes Belkada's avatar Younes Belkada Committed by GitHub
Browse files

Blip: Deprecate `BlipModel` (#31235)

* deprecate blip

* mention deprecation on docs
parent fd3238b4
......@@ -66,6 +66,8 @@ The original code can be found [here](https://github.com/salesforce/BLIP).
## BlipModel
`BlipModel` is going to be deprecated in future versions, please use `BlipForConditionalGeneration`, `BlipForImageTextRetrieval` or `BlipForQuestionAnswering` depending on your usecase.
[[autodoc]] BlipModel
- forward
- get_text_features
......
......@@ -742,7 +742,12 @@ class BlipVisionModel(BlipPreTrainedModel):
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):
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.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
self.post_init()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment