jina-embed-api / app.py
sergiu811's picture
Create app.py
ea71e3a verified
raw
history blame contribute delete
428 Bytes
import gradio as gr
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("jinaai/jina-embeddings-v2-small-en")
def embed(text):
embedding = model.encode(text).tolist()
return embedding
gr.Interface(
fn=embed,
inputs=gr.Textbox(label="Text"),
outputs="json",
title="Jina Embedding Model",
description="Get embeddings using jinaai/jina-embeddings-v2-small-en"
).launch()