sayakpaul HF staff commited on
Commit
f16a80a
1 Parent(s): 1a9773e

modify position id blocks.

Browse files
Files changed (1) hide show
  1. conversion_utils/text_encoder.py +4 -4
conversion_utils/text_encoder.py CHANGED
@@ -102,9 +102,9 @@ def populate_text_encoder(tf_text_encoder: tf.keras.Model) -> Dict[str, torch.Te
102
  layer.get_weights()[1]
103
  )
104
 
105
- # Position ids.
106
- text_state_dict["text_model.embeddings.position_ids"] = torch.tensor(
107
- list(range(77))
108
- ).unsqueeze(0)
109
 
110
  return text_state_dict
 
102
  layer.get_weights()[1]
103
  )
104
 
105
+ # Position ids.
106
+ text_state_dict["text_model.embeddings.position_ids"] = torch.tensor(
107
+ list(range(MAX_SEQ_LENGTH))
108
+ ).unsqueeze(0)
109
 
110
  return text_state_dict