MCPcopy
hub / github.com/HIT-SCIR/ltp / forward

Method forward

python/core/ltp_core/models/lit_model.py:66–82  ·  view source on GitHub ↗
(
        self,
        task_name: str,
        input_ids: torch.Tensor,
        attention_mask: torch.Tensor,
        token_type_ids: torch.Tensor = None,
        word_index: torch.Tensor = None,
        word_attention_mask: torch.Tensor = None,
    )

Source from the content-addressed store, hash-verified

64 self.mean_metrics = MeanMetric()
65
66 def forward(
67 self,
68 task_name: str,
69 input_ids: torch.Tensor,
70 attention_mask: torch.Tensor,
71 token_type_ids: torch.Tensor = None,
72 word_index: torch.Tensor = None,
73 word_attention_mask: torch.Tensor = None,
74 ):
75 return self.model(
76 task_name,
77 input_ids,
78 attention_mask,
79 token_type_ids,
80 word_index,
81 word_attention_mask,
82 )
83
84 def step(self, task_name: str, batch: Any):
85 inout_ids = batch["input_ids"]

Callers 1

stepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected