def embed(text_list: List[str], model="sensenova/piccolo-large-zh", url="http://110.42.225.197:9001/v1/embeddings",
headers={"Content-Type": "application/json"}):
''' embed text with sensenova/piccolo model '''
data = {
"input": text_list,
"model": model
}
response = requests.post(url=url, headers=headers, json=data)
This is part of a method I have that tries to use the model to embed texts, it has worked, but when I opened the code one days later I got error message:
Traceback (most recent call last):
File “(myfilepath)”, line 1, in
from embedder import query
File “”, line 149, in
process_srt_file(file_path)
File “(myfilepath)”, line 51, in process_srt_file
embeddings = embed(text_captions)
^^^^^^^^^^^^^^^^^^^^
File “(myfilepath)”, line 34, in embed
raise Exception(f”Request failed with status code {response.status_code}”)
Exception: Request failed with status code 503
Does anyone know what’s happening?
I tried to add proxies settings in request parameter but didn’t work
Amelia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.