MCPcopy Create free account
hub / github.com/evilsocket/cake / forward

Method forward

cake-core/src/models/vibevoice/eos_classifier.rs:36–41  ·  view source on GitHub ↗

Predict EOS probability. Input: (batch, hidden_size) LLM hidden state. Output: (batch, 1) probability (after sigmoid).

(&self, x: &Tensor)

Source from the content-addressed store, hash-verified

34 /// Input: (batch, hidden_size) LLM hidden state.
35 /// Output: (batch, 1) probability (after sigmoid).
36 pub fn forward(&self, x: &Tensor) -> Result<Tensor> {
37 let h = self.backend.linear_forward(x, &self.fc1_weight, self.fc1_bias.as_ref())?;
38 let h = self.backend.silu(&h)?;
39 let h = self.backend.linear_forward(&h, &self.fc2_weight, self.fc2_bias.as_ref())?;
40 self.backend.sigmoid(&h)
41 }
42
43 /// Check if generation should stop (probability > threshold).
44 pub fn should_stop(&self, x: &Tensor, threshold: f32) -> Result<bool> {

Callers 6

sample_speech_latentMethod · 0.45
generateMethod · 0.45
generateMethod · 0.45
should_stopMethod · 0.45

Calls 3

linear_forwardMethod · 0.45
siluMethod · 0.45
sigmoidMethod · 0.45

Tested by 1