You'll have to check what kind of output your hosted model is returning coz from the above method you have to return only the embeddings!
also for your case, code would be something like this:
def _get_query_embedding(self, query: str) -> List[float]:
# ADDED ONE SAMPLE HERE
response = requests.post(API_URL, headers=headers, json=payload)
embeddings = response.json()
return embeddings
def _get_text_embedding(self, text: str) -> List[float]:
embeddings = self._model.encode([[self._instruction, text]])
return embeddings[0]
def _get_text_embeddings(self, texts: List[str]) -> List[List[float]]:
embeddings = self._model.encode(
[[self._instruction, text] for text in texts]