mirror of
https://github.com/SillyTavern/SillyTavern-Extras.git
synced 2026-01-26 17:20:04 +00:00
add clarifying progress message
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user