def get_embeddings(tokenizer, model, texts):
    """Return the embeddings for a list of texts."""
    inputs = tokenizer(texts,
                       padding=True,
                       truncation=True,
                       return_tensors="pt",
                       max_length=512)
    result = model(**inputs)
    embeddings = result.last_hidden_state[:, 0, :]
    return embeddings