Skip to content

Commit 2aca095

Browse files
committed
disable progress bar by default
1 parent 04736f1 commit 2aca095

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

redisvl/utils/vectorize/text/huggingface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def _embed(self, text: str, **kwargs) -> List[float]:
128128
if not isinstance(text, str):
129129
raise TypeError("Must pass in a str value to embed.")
130130

131+
if "show_progress_bar" not in kwargs:
132+
# disable annoying tqdm by default
133+
kwargs["show_progress_bar"] = False
134+
131135
embedding = self._client.encode([text], **kwargs)[0]
132136
return embedding.tolist()
133137

@@ -151,6 +155,9 @@ def _embed_many(
151155
raise TypeError("Must pass in a list of str values to embed.")
152156
if len(texts) > 0 and not isinstance(texts[0], str):
153157
raise TypeError("Must pass in a list of str values to embed.")
158+
if "show_progress_bar" not in kwargs:
159+
# disable annoying tqdm by default
160+
kwargs["show_progress_bar"] = False
154161

155162
embeddings: List = []
156163
for batch in self.batchify(texts, batch_size, None):

0 commit comments

Comments
 (0)