Here’s how you would directly make use of model2vec
Copy
Ask AI
from model2vec import StaticModel# Load a model from the HuggingFace hub (in this case the potion-base-8M model)model = StaticModel.from_pretrained("minishlab/potion-base-8M")# Make embeddingsembeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everybody."])# Make sequences of token embeddingstoken_embeddings = model.encode_as_sequence(["It's dangerous to go alone!", "It's a secret to everybody."])