MCPcopy Create free account
hub / github.com/ToTheBeginning/PuLID / drop_seq_token

Function drop_seq_token

pulid/utils.py:44–49  ·  view source on GitHub ↗
(seq, drop_rate=0.5)

Source from the content-addressed store, hash-verified

42
43
44def drop_seq_token(seq, drop_rate=0.5):
45 idx = torch.randperm(seq.size(1))
46 num_keep_tokens = int(len(idx) * (1 - drop_rate))
47 idx = idx[:num_keep_tokens]
48 seq = seq[:, idx]
49 return seq
50
51
52def import_model_class_from_model_name_or_path(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected