toilaluan commited on
Commit
b0112db
1 Parent(s): c0877fa

Update modeling_florence2.py

Browse files
Files changed (1) hide show
  1. modeling_florence2.py +2 -2
modeling_florence2.py CHANGED
@@ -2067,8 +2067,8 @@ class Florence2LanguageForConditionalGeneration(Florence2LanguagePreTrainedModel
2067
  def __init__(self, config: Florence2LanguageConfig):
2068
  super().__init__(config)
2069
  self.model = Florence2LanguageModel(config)
2070
- self.register_buffer("final_logits_bias", torch.zeros((1, self.model.shared.num_embeddings)))
2071
- self.lm_head = nn.Linear(config.d_model, self.model.shared.num_embeddings, bias=False)
2072
 
2073
  # Initialize weights and apply final processing
2074
  self.post_init()
 
2067
  def __init__(self, config: Florence2LanguageConfig):
2068
  super().__init__(config)
2069
  self.model = Florence2LanguageModel(config)
2070
+ self.register_buffer("final_logits_bias", torch.zeros((1, 1)))
2071
+ self.lm_head = nn.Linear(config.d_model, 1, bias=False)
2072
 
2073
  # Initialize weights and apply final processing
2074
  self.post_init()