(self, motion_token: Tensor, lengths: List[int])
| 388 | return cleaned_text |
| 389 | |
| 390 | def motion_token_to_string(self, motion_token: Tensor, lengths: List[int]): |
| 391 | motion_string = [] |
| 392 | for i in range(len(motion_token)): |
| 393 | motion_i = motion_token[i].cpu( |
| 394 | ) if motion_token[i].device.type == 'cuda' else motion_token[i] |
| 395 | motion_list = motion_i.tolist()[:lengths[i]] |
| 396 | motion_string.append( |
| 397 | (f'<motion_id_{self.m_codebook_size}>' + |
| 398 | ''.join([f'<motion_id_{int(i)}>' for i in motion_list]) + |
| 399 | f'<motion_id_{self.m_codebook_size + 1}>')) |
| 400 | return motion_string |
| 401 | |
| 402 | def motion_token_list_to_string(self, motion_token: Tensor): |
| 403 | motion_string = [] |
no outgoing calls
no test coverage detected