File size: 306 Bytes
9da3a06
25d16ac
9da3a06
25d16ac
9da3a06
25d16ac
 
 
 
0d1c353
25d16ac
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("all-mpnet-base-v2")

def get_embeddings(text):
    return model.encode(text).tolist()

gr.Interface(
    fn=get_embeddings,
    inputs="text",
    outputs="json",
    title="DiDef Embeddings"
).launch()