Ifaldzi
feat: add app and dockerfile
b80d55d
raw
history blame
301 Bytes
from fastapi import FastAPI
from sentence_transformers import SentenceTransformer
app = FastAPI()
model = SentenceTransformer("LazarusNLP/all-indobert-base-v3")
@app.post("/embeddings")
def embed_text(text: str):
embeddings = model.encode(text)
return {"embeddings": embeddings.tolist()}