Uasge

pip install -U FlagEmbedding

Generate embedding for text (only Dense)

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 ]]
Downloads last month
6
Safetensors
Model size
0.3B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for puppyyyo/larceny-large-ICT_v1

Finetuned
(4)
this model