Skip to content

Instantly share code, notes, and snippets.

View HSILA's full-sized avatar

HSILA HSILA

  • McMaster University
  • Canada
  • 12:51 (UTC -04:00)
View GitHub Profile
@HSILA
HSILA / BiEncoderWrapper.py
Created April 23, 2025 05:01
contrastors BiEncoderWrapper
import os
import numpy as np
from typing import Any
import torch
import mteb
from transformers import AutoTokenizer
@HSILA
HSILA / onnx_cumsum.py
Last active July 2, 2022 06:15
ONNX CumSum operator shouldn't get boolean but model checker won't check it
import torch
from torch import nn
import onnx
import onnxruntime
a = torch.tensor([12, 0, 5, 154], dtype=torch.float32)
# a.to(torch.bool) = tensor([True, False, True, True])
# ~a.to(torch.bool) = tensor([False, True, False, False])