-
Notifications
You must be signed in to change notification settings - Fork 561
feat: support langchain v1 #1472
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
base: develop
Are you sure you want to change the base?
Changes from all commits
3873c86
f048b56
1452984
9ce9d0c
23cbd32
69bd7f4
7ec9571
159246c
831f418
5deb278
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,10 +21,19 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| import pandas as pd | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import torch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from gpt4pandas import GPT4Pandas | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.chains import RetrievalQA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.embeddings import HuggingFaceEmbeddings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.text_splitter import CharacterTextSplitter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.vectorstores import FAISS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pouyanpi marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.chains import RetrievalQA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.embeddings import HuggingFaceEmbeddings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.text_splitter import CharacterTextSplitter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain.vectorstores import FAISS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| except ImportError as e: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| raise ImportError( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Failed to import required LangChain modules. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Ensure you have installed the correct version of langchain and its dependencies. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Original error: {e}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) from e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Missing langchain-classic fallback for LangChain 1.x users. These imports from
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from langchain_core.language_models.llms import BaseLLM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Import path
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.