We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d2887b commit 9a8b0ffCopy full SHA for 9a8b0ff
packages/tasks/src/model-libraries-snippets.ts
@@ -722,14 +722,11 @@ export const sentenceTransformers = (model: ModelData): string[] => {
722
return [
723
`from sentence_transformers import SentenceTransformer
724
725
-# Download from the 🤗 Hub
726
model = SentenceTransformer("${model.id}"${remote_code_snippet})
727
728
-# Run inference
729
texts = ${JSON.stringify(exampleSentences, null, 4)}
730
embeddings = model.encode(texts)
731
732
-# Get the similarity scores for the texts
733
similarities = model.similarity(embeddings, embeddings)
734
print(similarities.shape)
735
# [${exampleSentences.length}, ${exampleSentences.length}]`,
0 commit comments