Coder Social home page Coder Social logo

complete-langchain-tutorials's Introduction

Complete-Langchain-Tutorials

complete-langchain-tutorials's People

Contributors

krishnaik06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

complete-langchain-tutorials's Issues

Unable to install package langchain_google_genai

getting error while installing langchain_google_genai -

ERROR: Could not find a version that satisfies the requirement langchain-google-genai (from versions: none)
ERROR: No matching distribution found for langchain-google-genai

chatmultipledocuments/chatpdf1.py - Got Value Error ValueError: The de-serialization relies loading a pickle file. Pickle files can be modified to deliver a malicious payload that results in execution of arbitrary code on your machine.You will need to set `allow_dangerous_deserialization` to `True` to enable deserialization. If you do this, make sure that you trust the source of the data. For example, if you are loading a file that you created, and no that no one else has modified the file, then this is safe to do. Do not set this to `True` if you are loading a file from an untrusted source (e.g., some random site on the internet.).

Screenshot 2024-04-15 130713

ValueError: The de-serialization relies loading a pickle file. Pickle files can be modified to deliver a malicious payload that results in execution of arbitrary code on your machine.You will need to set allow_dangerous_deserialization to True to enable deserialization. If you do this, make sure that you trust the source of the data. For example, if you are loading a file that you created, and no that no one else has modified the file, then this is safe to do. Do not set this to True if you are loading a file from an untrusted source (e.g., some random site on the internet.).
Traceback:
File "C:\Users\pmanne\Downloads\Gemini\gemini\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 584, in _run_script
exec(code, module.dict)
File "C:\Users\pmanne\Downloads\Gemini\geminipdfchatbot.py", line 107, in
main()
File "C:\Users\pmanne\Downloads\Gemini\geminipdfchatbot.py", line 92, in main
user_input(user_question)
File "C:\Users\pmanne\Downloads\Gemini\geminipdfchatbot.py", line 69, in user_input
new_db = FAISS.load_local("faiss_index", embeddings)
File "C:\Users\pmanne\Downloads\Gemini\gemini\lib\site-packages\langchain_community\vectorstores\faiss.py", line 1078, in load_local
raise ValueError(

Call Depreceated use Invoke Instead

Getting the following Error from Terminal, while my browser is stuck at a infinite loop:

LangChainDeprecationWarning: The function call was deprecated in LangChain 0.1.7 and will be removed in 0.2.0. Use invoke instead.
My Code:

Untitled

ValueError: Error raised by inference API:

This snippet is throwing a valueError how can we resolve this any thoughts?

from langchain import HuggingFaceHub
llm_hf = HuggingFaceHub(huggingfacehub_api_token="HUGGINGFACEHUB_API_TOKEN",
                        repo_id="google/flan-t5-large",
                        model_kwargs={
                            "temperature":0,
                            "max_length":64
                        })

output=llm_hf.predict("Can you tell me the capital of Bangladesh")

print(output)

Output:

    ValueError                                Traceback (most recent call last)
    ---->  output=llm_hf.predict("Can you tell me the capital of Bangladesh")
              print(output)
   
 ValueError: Error raised by inference API: Authorization header is correct, but the token seems invalid

Unused variable `doc` assigned but not being returned. Proper chunked data not being processed

In LLM Generic APP > test.ipynb in the method chunk_data it is currently returning docs and should return doc. In its current form, doc is an unused variable.

Currently this function doesn't do anything other than pass through the original docs argument .

See below where doc is currently being unused:

def chunk_data(docs,chunk_size=800,chunk_overlap=50):
    text_splitter=RecursiveCharacterTextSplitter(chunk_size=chunk_size,chunk_overlap=chunk_overlap)
    doc=text_splitter.split_documents(docs)  # <-- doc unused
    return docs  # <-- returning initial docs argument

Unable to use CTransformers

I am using the same app.py, but there seems to be some issue with this line
llm = CTransformers( model_type='llama', model='models/llama-2-7b.ggmlv3.q8_0.bin', config={'max_new_tokens': 256, 'temperature': 0.01} )

this is giving following error:
Repository Not Found for url: https://huggingface.co/api/models/models/llama-2-7b-chat.ggmlv3.q8_0.bin/revision/main.
Please make sure you specified the correct repo_id and repo_type.
If you are trying to access a private or gated repo, make sure you are authenticated.

I have downloaded the model locally, how can I use it? @krishnaik06

{'output_text': 'Answer is not available in the context'}

chatmultipledocuments -- I try to run this code, but whatever question I am asking getting "{'output_text': 'Answer is not available in the context'}" this reply.
I have checked google_api_key which is working fine. Index created, but getting the above reply.
Please help me to know what went wrong.

Security warning

Hey Krish,

I took a quick look on your .ipynb and i want to notify you that you should remove the tokens. Maybe use the dotenv to load from .env file as mentionned in the app.

Keep up the good work really enjoy your tutorials. @krishnaik06

kr,
Fedi

dangerous_deserialization

Hello! I'm getting this error in the PDF app:

"ValueError: The de-serialization relies loading a pickle file. Pickle files can be modified to deliver a malicious payload that results in execution of arbitrary code on your machine.You will need to set allow_dangerous_deserialization to True to enable deserialization. If you do this, make sure that you trust the source of the data. For example, if you are loading a file that you created, and no that no one else has modified the file, then this is safe to do. Do not set this to True if you are loading a file from an untrusted source (e.g., some random site on the internet.)."

Issue with Faiss INDEX creation

RuntimeError: Error in __cdecl faiss::FileIOReader::FileIOReader(const char *) at D:\a\faiss-wheels\faiss-wheels\faiss\faiss\impl\io.cpp:68: Error: 'f' failed: could not open faiss_index\index.faiss for reading: No such file or directory

The Streamlit application for Chat with multiple PDFs has the issue while running I tried Figuring it out by manually creating a folder, hope sort it out soon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.