(text)
| 16 | |
| 17 | |
| 18 | def tokenizer(text): |
| 19 | result = tokenize( |
| 20 | text, |
| 21 | padding="max_length", |
| 22 | truncation=True, |
| 23 | max_length=77, |
| 24 | return_tensors="pt", |
| 25 | ) |
| 26 | return {k: v.squeeze(0) for k, v in result.items()} |
| 27 | |
| 28 | |
| 29 | PRETRAINED_PATH = "/mnt/fast/nobackup/users/hl01486/projects/contrastive_pretraining/CLAP/assets/checkpoints/epoch_top_0_audioset_no_fusion.pt" |
no test coverage detected