add clarifying progress message

This commit is contained in:
Juha Jeronen
2024-01-24 15:44:33 +02:00
parent 0e506b1ce8
commit 09c007b96c

View File

@@ -601,6 +601,7 @@ def api_embeddings_compute():
sentences: Union[str, List[str]] = data["text"] sentences: Union[str, List[str]] = data["text"]
if not (isinstance(sentences, str) or (isinstance(sentences, list) and all(isinstance(x, str) for x in sentences))): if not (isinstance(sentences, str) or (isinstance(sentences, list) and all(isinstance(x, str) for x in sentences))):
abort(400, '"text" must be string or array of strings') abort(400, '"text" must be string or array of strings')
print("Computing vector embedding")
vectors: Union[np.array, List[np.array]] = sentence_embedder.encode(sentences, vectors: Union[np.array, List[np.array]] = sentence_embedder.encode(sentences,
show_progress_bar=True, # on ST-extras console show_progress_bar=True, # on ST-extras console
convert_to_numpy=True, convert_to_numpy=True,