rdsarjito commited on
Commit
6afe076
·
1 Parent(s): 3e9fd4e
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -76,12 +76,12 @@ class LateFusionModel(nn.Module):
76
  self.text_model = text_model
77
  # MLP fusion layer (matching saved model structure)
78
  # Structure: Linear(2, hidden) -> ReLU -> Dropout -> Linear(hidden, 1)
79
- hidden_dim = 64 # Adjust if needed based on saved model
80
  self.fusion_mlp = nn.Sequential(
81
- nn.Linear(2, hidden_dim), # layer 0
82
  nn.ReLU(), # layer 1 (no params)
83
  nn.Dropout(0.1), # layer 2 (no params)
84
- nn.Linear(hidden_dim, 1) # layer 3
85
  )
86
 
87
  def forward(self, images, input_ids, attention_mask):
 
76
  self.text_model = text_model
77
  # MLP fusion layer (matching saved model structure)
78
  # Structure: Linear(2, hidden) -> ReLU -> Dropout -> Linear(hidden, 1)
79
+ hidden_dim = 16 # Matching saved model: [16, 2] -> [16] -> [1, 16]
80
  self.fusion_mlp = nn.Sequential(
81
+ nn.Linear(2, hidden_dim), # layer 0: [16, 2]
82
  nn.ReLU(), # layer 1 (no params)
83
  nn.Dropout(0.1), # layer 2 (no params)
84
+ nn.Linear(hidden_dim, 1) # layer 3: [1, 16]
85
  )
86
 
87
  def forward(self, images, input_ids, attention_mask):