import sentence_transformers as st org = "sentence-transformers" model_name = "all-MiniLM-L6-v2" model_id = f"{org}/{model_name}" model = st.SentenceTransformer(model_id) sentences = [ "Reset a user password", "Create an S3 bucket", ] embeddings = model.encode(sentences) get_dim = model.get_embedding_dimension reported_dim = get_dim() actual_dim = embeddings.shape[1] match = actual_dim == reported_dim print(f"model={model_name}") print(f"reported_dim={reported_dim}") print(f"shape={embeddings.shape}") print(f"match={match}") if not match: raise SystemExit( f"mismatch: shape={actual_dim}, dim={reported_dim}" )