embedding function
This commit is contained in:
commit
9788aba9be
6
embedding.py
Normal file
6
embedding.py
Normal file
@ -0,0 +1,6 @@
|
||||
import requests
|
||||
|
||||
def embed_text(url, model, text):
|
||||
response = requests.post(url=url, json={"model": model, "input": text} )
|
||||
data = response.json()
|
||||
return data["embeddings"][0]
|
||||
Loading…
Reference in New Issue
Block a user