(tokens, token_id)
| 385 | len_add_token = len(self.cond_stage_model.modifier_token_id) |
| 386 | |
| 387 | def get_token_indices(tokens, token_id): |
| 388 | indices = tokens == token_id |
| 389 | indices = (indices*1).unsqueeze(-1) |
| 390 | index_token = (indices == 1).nonzero() |
| 391 | index_token = index_token.tolist() |
| 392 | return index_token |
| 393 | |
| 394 | index_token = get_token_indices(tokens, self.cond_stage_model.modifier_token_id[-len_add_token]) |
| 395 | index_token_new2 = get_token_indices(tokens, self.cond_stage_model.modifier_token_id[-1]) |
nothing calls this directly
no outgoing calls
no test coverage detected