Skip to content

Update LangChain Tests #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Update LangChain Tests #498

merged 3 commits into from
Dec 13, 2023

Conversation

qiuosier
Copy link
Member

The current way of saving the original LangChain's get_type_to_cls_dict method is not correct.

cls.original_type_to_cls_dict = deepcopy(llms.get_type_to_cls_dict())

Because get_type_to_cls_dict is a function but the code is saving as a dictionary.

After running this test, the subsequent calls to get_type_to_cls_dict will fail with

TypeError: 'dict' object is not callable

Depending on the order when running the test, some tests may appear to fail randomly due to this issue:
https://github.com/oracle/accelerated-data-science/actions/runs/7137179363/job/19453780865#step:8:3440
https://github.com/oracle/accelerated-data-science/actions/runs/7115504771/job/19371812840

Since the embedding and LLM models in this test are for serialization only without inference. There is no need to use the "fake" one. We can use the real embedding and LLM models to avoid modifying get_type_to_cls_dict in LangChain.

This PR also updated the tests to skip checking ID fields in the serialization, since LangChain is updating frequently and this field might change. Users should use the same version of LangChain for serialization and de-serialization.

@qiuosier qiuosier requested a review from z7ye December 13, 2023 18:23
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 13, 2023
Copy link

📌 Cov diff with main:

Coverage-100%

📌 Overall coverage:

Coverage-62.14%

@qiuosier qiuosier merged commit 68c9ec4 into main Dec 13, 2023
@qiuosier qiuosier deleted the update_retrival_qa_test branch March 22, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants