MCPcopy Create free account
hub / github.com/csuhan/OneLLM / forward

Method forward

model/meta.py:47–57  ·  view source on GitHub ↗
(self, examples, labels, image=None, modal='image')

Source from the content-addressed store, hash-verified

45 print(f"Parameter count : {count}")
46
47 def forward(self, examples, labels, image=None, modal='image'):
48 output = self.llma(examples, image=image, modal=modal)
49 output = output[:, :-1, :]
50 labels = labels[:, 1:]
51
52 if labels.sum() == 0:
53 c_loss = output.mean() * 0
54 else:
55 c_loss = self.criterion(output.reshape(-1, 32000), labels.flatten())
56
57 return c_loss
58
59 def generate(
60 self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected