MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / clean_tree_text

Function clean_tree_text

seq2seq/constrained_seq2seq.py:38–39  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

36def decode_tree_str(sequences: Union[List[int], List[List[int]], "np.ndarray", "torch.Tensor"],
37 tokenizer: PreTrainedTokenizer) -> List[str]:
38 def clean_tree_text(x):
39 return x.replace('<pad>', '').replace('<s>', '').replace('</s>', '').strip()
40
41 sequences = np.where(sequences != -100, sequences, tokenizer.pad_token_id)
42

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected