mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 16:13:25 +00:00
import tqdm.auto instead of tqdm tqdm for OpenAIEmbeddings (#9584)
- Description: current code does not work very well on jupyter notebook, so I changed the code so that it imports `tqdm.auto` instead. - Issue: #9582 - Dependencies: N/A - Tag maintainer: @hwchase17, @baskaryan - Twitter handle: N/A Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
parent
35812d0096
commit
f1e602996a
@ -352,9 +352,9 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
|
|||||||
|
|
||||||
if self.show_progress_bar:
|
if self.show_progress_bar:
|
||||||
try:
|
try:
|
||||||
import tqdm
|
from tqdm.auto import tqdm
|
||||||
|
|
||||||
_iter = tqdm.tqdm(range(0, len(tokens), _chunk_size))
|
_iter = tqdm(range(0, len(tokens), _chunk_size))
|
||||||
except ImportError:
|
except ImportError:
|
||||||
_iter = range(0, len(tokens), _chunk_size)
|
_iter = range(0, len(tokens), _chunk_size)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user