Skip to content

Commit

Permalink
add temp param to Blip2ForImageTextRetrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
jpizarrom committed Sep 24, 2023
1 parent a9149f7 commit 6b502f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/models/blip_2/modeling_blip_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,8 @@ def __init__(self, config: Blip2Config):
# image text matching head
self.itm_head = nn.Linear(config.qformer_config.hidden_size, 2)

self.temp = nn.Parameter(0.07 * torch.ones([]))

# Initialize weights and apply final processing
self.post_init()

Expand Down

0 comments on commit 6b502f1

Please sign in to comment.