Upload folder using huggingface_hub
Browse files
modeling_internvl_chat.py
CHANGED
|
@@ -73,6 +73,8 @@ class InternVLChatModel(PreTrainedModel):
|
|
| 73 |
)
|
| 74 |
|
| 75 |
self.img_context_token_id = None
|
|
|
|
|
|
|
| 76 |
|
| 77 |
def forward(
|
| 78 |
self,
|
|
@@ -252,6 +254,7 @@ class InternVLChatModel(PreTrainedModel):
|
|
| 252 |
self.img_context_token_id = img_context_token_id
|
| 253 |
|
| 254 |
template = get_conv_template(self.template)
|
|
|
|
| 255 |
eos_token_id = tokenizer.convert_tokens_to_ids(template.sep)
|
| 256 |
|
| 257 |
history = [] if history is None else history
|
|
|
|
| 73 |
)
|
| 74 |
|
| 75 |
self.img_context_token_id = None
|
| 76 |
+
self.conv_template = get_conv_template(self.template)
|
| 77 |
+
self.system_message = self.conv_template.system_message
|
| 78 |
|
| 79 |
def forward(
|
| 80 |
self,
|
|
|
|
| 254 |
self.img_context_token_id = img_context_token_id
|
| 255 |
|
| 256 |
template = get_conv_template(self.template)
|
| 257 |
+
template.system_message = self.system_message
|
| 258 |
eos_token_id = tokenizer.convert_tokens_to_ids(template.sep)
|
| 259 |
|
| 260 |
history = [] if history is None else history
|