Spaces:
Sleeping
Sleeping
File size: 418 Bytes
d60dac5 ab843c1 d60dac5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import os
from dotenv import load_dotenv
from sentence_transformers import SentenceTransformer
load_dotenv()
API_TOKEN = os.getenv('HF_TOKEN')
API_URL = "/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Fall-distilroberta-v1%26quot%3B%3C%2Fspan%3E
headers = {"Authorization": f"Bearer {API_TOKEN}"}
def generate_text_embeddings(texts):
model = SentenceTransformer('all-distilroberta-v1')
return model.encode(texts)
# Example usage:
|