How to use onecd2000/modernbert-embed-test with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("onecd2000/modernbert-embed-test") sentences = [ "What do the packets contain that is essential for their travel?", "Packet switching breaks data into small packets, each containing a destination address. These packets travel independently across the network, taking different paths if necessary, and reassemble at the destination. This method proved to be more efficient and resilient, making it the backbone of modern internet communication.\n\nThe Birth of ARPANET", "Early Concepts of Networking", ". Researchers such as Paul Baran at RAND Corporation and Donald Davies at the National Physical Laboratory in the UK independently developed the concept of packet switching." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4]
The community tab is the place to discuss and collaborate with the HF community!