fastai / nbdev

Create delightful software with Jupyter Notebooks
https://nbdev.fast.ai/
Apache License 2.0
4.8k stars 484 forks source link

`nbdev_test` fails to run tests when preceded by `langchain.embeddings.HuggingFaceEmbeddings` #1368

Closed amaiya closed 9 months ago

amaiya commented 9 months ago

Importing and instantiating langchain.embeddings.HuggingFaceEmbeddings causes nbdev_test to malfunction and not execute subsequent tests.

Steps to Reproduce

  1. In a new repo folder (using nbdev_new) or existing nbdev repo, add the following in a notebook cell (e.g., in 00_core.ipynb):
    from langchain.embeddings import HuggingFaceEmbeddings
    emb = HuggingFaceEmbeddings()
    assert 1==2, 'never executed by nbdev_test'
  2. Run the test: nbdev_test --do_print --file_re core.ipynb.
  3. The nbdev_test returns Success when it should be failing.

Interestingly, it only happens with langchain.embeddings.HuggingFaceEmbeddings, not when using sentence_transformers directly.

amaiya commented 9 months ago

Closed as the problem goes away when re-installing from scratch.