api_second_attempt / python_chunk.Rmd
aoiferyan's picture
Upload folder using huggingface_hub
ff3f7f1 verified
raw
history blame contribute delete
422 Bytes
---
title: "Untitled"
output: html_document
date: "2024-04-04"
---
```{python}
from sentence_transformers import SentenceTransformer
import pandas as pd
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('sentence-transformers/all-miniLM-L6-v2')
embeddings = model.encode(sentences)
embeddings_df = pd.DataFrame(embeddings)
embeddings_df.to_csv("embeddings.csv")
```