Spaces:
Build error
Build error
modify position id blocks.
Browse files
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 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
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
|