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() |