mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +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:
|
||||
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:
|
||||
_iter = range(0, len(tokens), _chunk_size)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user