harbor run -t openthoughts/tasktrove-exp-rle-adversarial-5k-adversarial-1724harbor download openthoughts/tasktrove-exp-rle-adversarial-5k-adversarial-1724Task: Implement the PyTorch loss utilities used by the finetuning module
Objective
Deliverables
get_distance(embeddings: Tensor, distance: str) -> Tensor
NTXentLoss (contrastive loss for multiple views)
SiameseLoss (contrastive loss over pairwise relations)
TripletLoss (triplet-based margin loss)
Compatibility and tests
Implementation details and guidance
Notes
By completing this task, you will provide a robust, reusable loss utilities module that the tests exercise and that can be used by the rest of the finetuning framework.
Output only the instruction: