Downloads · 30 days
13
12% of all-time downloads
puppyyyo/larceny-large-ICT_v2
larceny-large-ICT_v2 is a machine learning model from puppyyyo. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
13
12% of all-time downloads
All-time downloads
105
Public
Parameters
326M
651 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors651 MB · 100%
From the Hugging Face model README
pip install -U FlagEmbedding
import torch
from FlagEmbedding import FlagModel
model_name = "puppyyyo/larceny-large-law-knowledge-v1"
devices = "cuda:0" if torch.cuda.is_available() else "cpu"
model = FlagModel(
model_name,
devices=devices,
use_fp16=False
)
sentences_1 = ["What is BGE M3?", "Defination of BM25"]
sentences_2 = ["BGE M3 is an embedding model supporting dense retrieval, lexical matching and multi-vector interaction.",
"BM25 is a bag-of-words retrieval function that ranks a set of documents based on the query terms appearing in each document"]
embeddings_1 = model.encode(sentences_1)
embeddings_2 = model.encode(sentences_2)
similarity = embeddings_1 @ embeddings_2.T
print(similarity)
# large-v1
# [[0.733249 0.6130755 ], [0.6454491 0.70350605]]
# large-v2
# [[0.74249226 0.49762917], [0.46898955 0.6974889 ]]
# large-v3
# [[0.659307 0.49970132], [0.51249266 0.6030095 ]]