HexPlex0xFF commited on
Commit
0a3c458
·
1 Parent(s): 316a14d

fixed bugs

Browse files
Files changed (2) hide show
  1. build_mlp.py +1 -1
  2. modeling_internlm_xcomposer2.py +3 -3
build_mlp.py CHANGED
@@ -84,7 +84,7 @@ class CLIPVisionTower(nn.Module):
84
  pos_tokens = pos_embed_checkpoint[:, num_extra_tokens:]
85
  pos_tokens = pos_tokens.reshape(-1, orig_size, orig_size,
86
  embedding_size).permute(
87
- 0, 3, 1, 2)
88
  pos_tokens = torch.nn.functional.interpolate(
89
  pos_tokens,
90
  size=(new_size, new_size),
 
84
  pos_tokens = pos_embed_checkpoint[:, num_extra_tokens:]
85
  pos_tokens = pos_tokens.reshape(-1, orig_size, orig_size,
86
  embedding_size).permute(
87
+ 0, 3, 1, 2).float()
88
  pos_tokens = torch.nn.functional.interpolate(
89
  pos_tokens,
90
  size=(new_size, new_size),
modeling_internlm_xcomposer2.py CHANGED
@@ -483,9 +483,9 @@ class InternLMXComposer2ForCausalLM(InternLM2PreTrainedModel):
483
  top_p: float = 0.8,
484
  repetition_penalty: float=1.005,
485
  meta_instruction:
486
- str = 'You are an AI assistant whose name is InternLM-XComposer (浦语·灵笔).\n'
487
- '- InternLM-XComposer (浦语·灵笔) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.\n'
488
- '- InternLM-XComposer (浦语·灵笔) can understand and communicate fluently in the language chosen by the user such as English and 中文.',
489
  **kwargs,
490
  ):
491
  if image is None:
 
483
  top_p: float = 0.8,
484
  repetition_penalty: float=1.005,
485
  meta_instruction:
486
+ str = 'You are an AI assistant whose name is InternLM-XComposer.\n'
487
+ '- InternLM-XComposer is a conversational language model that is developed by Shanghai AI Laboratory. It is designed to be helpful, honest, and harmless.\n'
488
+ '- InternLM-XComposer can understand and communicate fluently in English. You must respond only in English.',
489
  **kwargs,
490
  ):
491
  if image is None: