visheratin commited on
Commit
0953ba5
1 Parent(s): 800746d

Update new model

Browse files
Files changed (1) hide show
  1. modeling_llava.py +2 -7
modeling_llava.py CHANGED
@@ -35,8 +35,8 @@ class LlavaMultiModalProjector(nn.Module):
35
  )
36
  self.act = nn.GELU()
37
  self.linear_2 = nn.Linear(
38
- config.text_config.n_embd * config.projector_tokens_num,
39
- config.text_config.n_embd * config.projector_tokens_num,
40
  bias=True,
41
  )
42
  self.projector_tokens_num = config.projector_tokens_num
@@ -45,11 +45,6 @@ class LlavaMultiModalProjector(nn.Module):
45
  hidden_states = self.linear_1(image_features)
46
  hidden_states = self.act(hidden_states)
47
  hidden_states = self.linear_2(hidden_states)
48
- hidden_states = hidden_states.reshape(
49
- hidden_states.shape[0],
50
- self.projector_tokens_num,
51
- int(hidden_states.shape[1] / self.projector_tokens_num),
52
- )
53
  return hidden_states
54
 
55
 
 
35
  )
36
  self.act = nn.GELU()
37
  self.linear_2 = nn.Linear(
38
+ config.text_config.n_embd * 5,
39
+ config.text_config.n_embd,
40
  bias=True,
41
  )
42
  self.projector_tokens_num = config.projector_tokens_num
 
45
  hidden_states = self.linear_1(image_features)
46
  hidden_states = self.act(hidden_states)
47
  hidden_states = self.linear_2(hidden_states)
 
 
 
 
 
48
  return hidden_states
49
 
50