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