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:
Myeongseop Kim 2023-08-23 03:54:07 +09:00 committed by GitHub
parent 35812d0096
commit f1e602996a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: