ydshieh
commited on
Commit
•
9aceda3
1
Parent(s):
4bf5c74
fix pad token id issue
Browse files
vit_gpt2/configuration_vit_gpt2.py
CHANGED
@@ -31,6 +31,13 @@ class ViTGPT2Config(PretrainedConfig):
|
|
31 |
|
32 |
self.is_encoder_decoder = True
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
self.decoder_start_token_id = self.text_config.bos_token_id
|
35 |
self.forced_eos_token_id = self.text_config.eos_token_id
|
36 |
|
|
|
31 |
|
32 |
self.is_encoder_decoder = True
|
33 |
|
34 |
+
# Required in `generate()`.
|
35 |
+
self.bos_token_id = self.text_config.bos_token_id
|
36 |
+
self.eos_token_id = self.text_config.eos_token_id
|
37 |
+
|
38 |
+
assert hasattr(self.text_config, 'pad_token_id')
|
39 |
+
self.pad_token_id = self.text_config.pad_token_id
|
40 |
+
|
41 |
self.decoder_start_token_id = self.text_config.bos_token_id
|
42 |
self.forced_eos_token_id = self.text_config.eos_token_id
|
43 |
|