Skip to content

LangChain Error #10

@yeongnamtan

Description

@yeongnamtan

When I run the script, it says install langhhain_community instead.

home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain/embeddings/init.py:29: LangChainDeprecationWarning: Importing embeddings from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.embeddings import GooglePalmEmbeddings.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain/llms/init.py:548: LangChainDeprecationWarning: Importing LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.llms import GooglePalm.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain/vectorstores/init.py:35: LangChainDeprecationWarning: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.vectorstores import FAISS.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
2024-03-18 06:50:54.539 Uncaught app exception
Traceback (most recent call last):
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/home/sagemaker-user/streamlitapp/chat_with_multiple_pdfs_with_googlepalm2_and_langchain.py", line 90, in
main()
File "/home/sagemaker-user/streamlitapp/chat_with_multiple_pdfs_with_googlepalm2_and_langchain.py", line 84, in main
st.session_state.conversation = get_conversational_chain(vector_store) #sets up and stores the conversational system or related information in the Streamlit application's session state. This allows the application to maintain and access the conversational system across different user interactions and sessions
File "/home/sagemaker-user/streamlitapp/chat_with_multiple_pdfs_with_googlepalm2_and_langchain.py", line 47, in get_conversational_chain
llm=GooglePalm() #initialise Language Model in this case google palm
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain_core/_api/deprecation.py", line 179, in warn_if_direct_instance
emit_warning()
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain_core/_api/deprecation.py", line 117, in emit_warning
warn_deprecated(

After I change to langchain-community, i get below error ....

2024-03-18 06:55:38.620 Uncaught app exception
Traceback (most recent call last):
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "/home/sagemaker-user/streamlitapp/chat_with_multiple_pdfs_with_googlepalm2_and_langchain.py", line 93, in
main()
File "/home/sagemaker-user/streamlitapp/chat_with_multiple_pdfs_with_googlepalm2_and_langchain.py", line 87, in main
st.session_state.conversation = get_conversational_chain(vector_store) #sets up and stores the conversational system or related information in the Streamlit application's session state. This allows the application to maintain and access the conversational system across different user interactions and sessions
File "/home/sagemaker-user/streamlitapp/chat_with_multiple_pdfs_with_googlepalm2_and_langchain.py", line 50, in get_conversational_chain
llm=GooglePalm() #initialise Language Model in this case google palm
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain_core/_api/deprecation.py", line 179, in warn_if_direct_instance
emit_warning()
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain_core/_api/deprecation.py", line 117, in emit_warning
warn_deprecated(
File "/home/sagemaker-user/streamlitenv/lib/python3.9/site-packages/langchain_core/_api/deprecation.py", line 337, in warn_deprecated
raise NotImplementedError(
NotImplementedError: Need to determine which default deprecation schedule to use. within ?? minor releases

appreciate your help ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions