Search Your PDF App using Langchain, ChromaDB, and Open Source LLM: No OpenAI API (Runs on CPU)
Vložit
- čas přidán 22. 08. 2024
- Welcome to this tutorial video where we introduce an innovative approach to searching your PDF application using the power of Langchain, ChromaDB, and Open Source LLM, all running on your CPU.
Langchain is a powerful library designed for generative AI tasks, providing a range of capabilities that enhance language generation and understanding.
ChromaDB, on the other hand, acts as a vector store and database, enabling us to store and retrieve vectors efficiently. By integrating ChromaDB into our search tool, we can create a robust and scalable solution for managing the vector representations of PDF documents, allowing for faster and more accurate searches.
Finally, we utilize an Open Source LLM (Language Model) to enable question-answering capabilities within our search tool. With the power of LLM, we can process user queries and extract relevant information from PDF documents, providing precise and context-aware answers to the user's questions.
The unique aspect of this tutorial is that we do not rely on the OpenAI API, meaning you can run this entire system on your CPU without the need for external services. This ensures greater control, privacy, and accessibility for your PDF search needs.
Join us in this tutorial video as we guide you through the process of building your own PDF search tool using Langchain, ChromaDB, and Open Source LLM. Discover how to harness the potential of these technologies to create a powerful and efficient search system tailored to your requirements. Let's unlock the potential of your PDF application and revolutionize the way you search for information.
AI Anytime's GitHub: github.com/AIA...
LaMiNi LM Model: huggingface.co...
ChromaDB: www.trychroma....
Langchain: python.langcha...
LLM Playlist: • Large Language Models
Join WhatsApp: chat.whatsapp.....
#langchain #python #ai
Awesome, this is what real people need, a free alternative of custom knowledge Q&A to OpenAI. I've tried privateGPT but it is too slow taking 2 minutes to provide answers while consuming 16-RAM and woring in the command prompt. This model looks much better, I'll be looking forward for the chatbot variant. Thank you!
Thanks for your kind words! I agree with you,,,,,,,, The chatbot video will be released by tomorrow.
You are a blessing my guy. Amazing, thanks for taking your time and teaching this. Truly Appreciate your efforts.
Hi thanks for your videos i have seen and subscribed you because your explaination process is very easy to understand
You are doing a superb job! These videos not only give knowledge, but motivates us to learn GenAI and start writing few pieces of code towards the use cases. Keep doing such use case driven videos, trust me that the community will appreciate and embrace folks like you. Keep rocking!
So nice of you
Many of the settings and imports have been deprecated and you will get many errors. I recommend not using this code but just learning the work flow and the thinking processes. Thank you still for this video.
Instructive and thorough, appreicate your efforts!
Thank you Sir, please consider subscribing to the channel.
What if we ask a question that is not from PDF?
13:30 why vectorstore?
17:18 safe tensors
20:12 project ideas
40:00 device_map
45:12 streamlit cache resource (decorator)
49:00 chaintype
1:01:47 token size (how it affects answers)
Thank you for putting this tutorial together. It would be great if you could also include the versions of the packages you use in your requirements.txt because the packages change so fast and many things dont work anymore
Did u manage to run the project??
Let me update the GitHub repo with the version. Thanks
@@253_r.asidharth8 no not yet due to newer package version
@@AIAnytimeMay I know when will you update the requirements.txt file with versions you used?
I'm glad that I found your channel brother 🙌❤
Welcome aboard! Thanks. Plz keep supporting.
Hello sir , can you please help me with an error:ModuleNotFoundError: No module named 'langchain' ? I have installed langchain and have checked it pip show langchain
Very well explained video, and nice content. Congratulations!
Thanks a lot!
it happened to me every time 😭
i follow the video and do everything right but i still have problems
i install python 3.10 then create a new environment and install the requirements then i downloaded the model.
i think the error are from incompatible version ?
need help please.
Yes same, I'm unable to create the parquet files properly like he did, it's also asking me to use huggingfaceembeddings instead of sentences transformer embeddings. Someone please help out
Please help. Tried your method but getting the following error:
Uncaught app exception
Traceback (most recent call last):
File "C:\Users\Ahead06\Documents\Chatbot\CHATBOT3\lib\site-packages\streamlit
untime\scriptrunner\exec_code.py", line 85, in exec_func_with_error_handling
result = func()
;;
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.
Is it possible to deploy a chatbot that has been fine-tuned using a custom knowledge base and the Llama2 framework on a live production website? My plan is to fine-tune the chatbot with data derived from 100 pages of PDF documents. The aim is for the chatbot to interact with online users and generate responses based on this material. If the chatbot is anticipated to engage with approximately 2,000 users per month and accommodate at least 20 users simultaneously, could you offer a rough estimate of the projected costs?
hi, do you get any idea about that, i hope you will answer it
Doesnt work getting crazzy error with embdeggins both with huggingfqce a d sentence transformer
Yes I got the same error
'Chromadb' is not compatible with Python 3.11. I'm trying to find a work around, but a very well-developed course. Thank you.
Did you find the solution?
Hello bro , since my PC low end is it possible to the the llm models on azure and access from there and make the same application and also deploy it online
I think if we ask general questions lik “who is naredra modi?” It will answer out of the pdf files
Thanks alot
I learned alot. I will try doiing this tutorial.
Glad it was helpful!
Superb video. So easy to follow...
Thanks a lot 😊
How to handle and maintain chroma db for multiple user requests, and how we know which directory belongs to which user request in 2-tier architecture
The kid smoking in the background distracted me 😂
ERROR: Ignored the following versions that require a different python version: 0.55.2 Requires-Python
ImportError: Using `low_cpu_mem_usage=True` or a `device_map` requires Accelerate: `pip install accelerate`
I was getting error on install of packages than i remove version and install its work on langchain_community but its not working
Traceback (most recent call last):
File "C:\xampp\htdocs\asktoai\ingest.py", line 6, in
from constants import CHROMA_SETTINGS
File "C:\xampp\htdocs\asktoai\constants.py", line 2, in
import chromadb.config
Awesome demo. Would you please let me know where to download the repo of this demo. I did not find it on your github. Thanks.
It's on my GitHub. Please check the repositories.
What will it cost to host it in a server? Suppose I have 1000 users daily and use it how much would I need to pay for such PDF searching feature? *Please reply* . I am a noob on AI server side hosting.
Great work man.. this really helps
Glad it helped
@@AIAnytime getting error -
ValueError: weight is on the meta device, we need a `value` to put in on cpu.
Great explain! I did the same as you did in the video but got some errors so is there any way to reach you, Really need your help.
How can I help you? My credentials are on about channel or on CZcams banner.
showing this error Even after updating chroma and also migrating it
"ValueError: You are using a deprecated configuration of Chroma."
ya getting the same error
Please consider investing in a microphone thst will enhance the quality of audio in the videos
Sure sir
I am getting this error - " AttributeError: 'Collection' object has no attribute '__pydantic_extra__' " why?
how to solve this AttributeError: 'Client' object has no attribute 'chroma_api_impl'?
How can I make my streamlit + chromadb application faster? I'm loading locally 30 pdf files and when I run the application, It takes like 40 minutes to load the documents and, after, it loads the streamlit interface. Is there a way where I can reduce this time? Is there a way to work with multithreading or multiparallelism in chromadb?
Super awesome tutorial! I wonder if you want to search pdfs in folders and subfolders.. what would be the code for that?
Many people’s build like this but there is no solution to restrict the model to answer only for pdf files
Too much great working
Can we also give large files as input file (1000 pages)
Hi, is a perfecto tutorial, great working!. I have a question. Even though I ask questions in Spanish, he answers me in English. Where can you define the language?
Is there any model in Spanish similar to this one that can be integrated?
Yes you can try something like 'GPT-2 SMALL SPANISH '... Explore on Huggingface models.
Please subscribe to the channel if this helps. Thanks
@@AIAnytime thanks
sir i made an offload folder , because it asked me to , but when i do 1 query it is making 2.5 gb something files in the offload folder , so how to solve it , please help
ValueError: You are using a deprecated configuration of Chroma.
Downgrade chromadb version
pip uninstall chromadb
pip install chromadb==0.3.29
Very nice! can you load multiple PDF files for Q&A?
Yes of course! Make sure your machine has enough compute power for inference. You can invest multiple files to create embeddings on any machine.
Hi, this is great tutorial and really helped me, shifting from Machine Learning to Generative AI is really amazing. It would be great if you create app for the same using Flask and Docker
I have an app where i have containerised the app. Plz watch those 2 videos as well.
@@AIAnytime Could you please share the link. Thanks for quick reply
can u share link please? @@AIAnytime
Can i use falcon 40b in the place that llm u r using???
Ofcourse you can. Make sure you have enough compute power.
great video
what about supabase for vector store?
That's a good choice.
PLEASE TELL ME THE SYSTEM CONFUGURATION REQUIRED FOR THIS....
I HAVE DONE BUT SHOWING Load_weight proeblem
Hi Sir, can you please tell me if the Text Summarization using LaMiniT5 248M and This Search your PDF using LaMiniT5 738M can be integrated and made into one single project??? PLS Answer sir.
hi cannot install chromadb --error failed
Awesome tutorial. Is there a way of embedding this into a webpage? Also, is there a way to customize the appearance of the streamlit GUI.
How to deploy this RAG model in aws. I mean what services we can use to deploy other than EC2?
Really Interesting, I was wondering how to mix it with the oobabooga repo, add some options like load various PDFs, load CSV, XLM, and other type of documents (power point, .txt, and others) with some DDBB behind for user access... that would be awesome!
Cool idea! Maybe I can see if I can create a video soon.
Great! If you need a concept of use let me know, I already tryied and mixed both git repost and they are working fine, the best is to have access to add LORA trained on obabooga to be used under langchain!@@AIAnytime
Traceback (most recent call last):
File "D:\coding\Webkul_interview\ollama\vectorbd.py", line 4, in
from constants import CHROMA_SETTINGS
ImportError: cannot import name 'CHROMA_SETTINGS' from 'constants' (d:\coding\Webkul_interview\ollama\env\Lib\site-packages\constants.py)
resolve error
@@STACKCODE Please tell me as well how did you do it
i am facing the same error
Awesome video... can you pls suggest any model for querying the Portuguese PDF document ?
This is without any subscription to any form. Does this code have a Google Colab page for testing? Once the libraries are downloaded, will the code work?
@AIAnytime can we get the images also from pdf in answer ?
Thank you for the awesome video. With the source citation does it also give images from the pdf in the answer?
I have few questions. What other models besides lamini can I use? I am trying to use llama2 or bloom. Also, what API should I use if I dont want to download the llm
Look at my latest video.... Using Zephyr and Mistral LLMs.
Awosome but i want to use Lamini model online not offline becuse my RAM is 8 GB it crashed after running how to achieve that thanks in advance...
what python version are you using?
great video, if i replace the checkpoint with any other model (eg. google/mt5), will the project still work as intended?
Yes, absolutely! It should work if you have a decent machine that can load the model in memory.
@@AIAnytime thank you, you have been very helpful
how can we do this with knowledge graph ?
Is it possible to change "all-MiniLM-L6-v2" per Watson LLM or any other paid LLM?
can you mention the version of python you are using here?
PDF file of resume is not output.
great vid!
Thank you.
AttributeError: chroma_api_impl
can you help me fix this please
Awesome!
Thank you! Cheers!
could you please do a video on same LMQL,Langchain and Chainlit together which takes multiple files of different format please
Sure Yash. Soon. Thanks for the idea.
@@AIAnytime thank you sir 😊
@@AIAnytime sir please make video on this as soon as you can 🙏
By Sunday. Currently in a family emergency. Apologies for the delay!
@@AIAnytime ok sir 🙂
I am getting this error
NotImplementedError: Cannot copy out of meta tensor; no data!
Any work arounds?
Did you find a solution?
Getting this error when i ran the code. Searched online, couldn't find a solution. Could you please help?
NotImplementedError: Cannot copy out of meta tensor; no data!
Are you running on CPU or CUDA?
@@AIAnytime cpu
How to connect you?The whatsapp link does not working...
Hello brother,
Can you please upload videos on how to evaluate llm model and which evaluation metrics can be used for specific usecase.
As I am getting this question in every interview and not able to answer itt
Since the cromadb is updated the code throwing some errors related to chromadb , can you please update those codes and push it your repo
Just a request, can you open a PR on GitHub repo? I will just merge that PR? Let me know... Just a few lines of code. They have migrated from duck db to sqlite.
Bookmark: 21:00
Hi, your videos are really very impressive. I am trying to recreate this but receiving the below error when executing ingest.py error Message: " duckdb.InvalidInputException: Invalid Input Error: Required module 'pandas.core.arrays.arrow.dtype' failed to import, due to the following Python
exception:
ModuleNotFoundError: No module named 'pandas.core.arrays.arrow.dtype' "
Can you look at the chroma db version you are using? Chroma db has recently migrated from duckdb to Sqlite. In that case, you need to make changes in Constants.py... do you mind looking at GitHub issues of this repo on my GitHub?
@@AIAnytime can i use old version of cromadb, will it work?
@@AIAnytime downgrade the version of cromadb and pandas: chromadb==0.3.26 , pandas==2.0.3 it worked for me, hope this helps others.
Chroma db error your using a deprecated configuration of chromo, some migrate
same error with me how come do you solve this
Hi. Sometime while running the model I'm getting the following error -Cannot copy out of meta tensor; no data! Any Idea how to solve this? Also I'm using faiss db instead of chroma. Thanks.
Can you check if you are offloading some weights to CPU? You using cuda or cpu as device map? Or auto?
@@AIAnytime I'm not off loading any weights to CPU. Also I'm using auto.
can we run with 8gb RAM ?
This is great! Thanks a lot! I love the way you are explaining every bits and pieces.
I am facing an error.
Till the 1st question the app is working but when ever I ask the 2nd question getting the below error
NotImplementedError: Cannot copy out of meta tensor; no data!
Any idea?
Thanks for your comments. Probably, you don't have much compute power. What's your laptop specs? And device_map is auto, CPU, or CUDA?
Where it is code???
where is code link??
Very nice tutorial. It helped me solve a issue I was working on. Could you please help as how can we reduce the latency of answers from ChatBot? Also what if the pdf of more than 100 pages?
Thanks for the comment. Infrastructure is the key and ofcourse some tweaking with the preprocessing and algorithms. Get a better compute power and you can see the improvement.
@@AIAnytime Thank you so much. Is there any way I can connect with you or any tutorial I should follow to scale things up after referring your tutorial?
Can you please update the version of all libraries. I am getting error in Chromadb because of version. Kindly do the needful
Hi did you update the libraries and resolved chromadb error?
Hello Brother,
Appreciate your work. But can you please update the requirements.txt with the version numbers, the versions are changed and we are facing problems running it.
Can you hurry?
Thank you.
try this...
pydantic==1.10.13
chromadb==0.3.26
langchain==0.0.267
streamlit==1.25.0
transformers==4.31.0
torch==2.0.1
einops==0.6.1
bitsandbytes==0.41.1
accelerate==0.21.0
pdfminer.six==20221105
beautifulsoup4==4.12.2
sentence-transformers
duckdb==0.7.1
sentencepiece==0.1.99
six==1.16.0
requests==2.31.0
uvicorn==0.18.3
torchvision==0.15.2
streamlit-chat
Hey great work man this really helps, could please explain in brief or if possible make a video about how vecrorDBs work internally? What are they exactly, word embeddings like starspace fasttext or sentence transformer embeddings over similarity search. How does this technology like langchain llama_index work internally
Hi Stephen, thanks for your comment. Maybe I can try doing that. But i feel there are many such videos available on CZcams. But yes I can explain in simpler terms. My focus is to help my subscribers build projects in Generative AI... But stay tuned 🔜
@@AIAnytime thanks a ton
i am getting an error NotImplementedError: Cannot copy out of meta tensor; no data!
did anyone face this error and is there any solution
yep facing the same! did u fixt it?
@@DeviGoneMad no
could not find a solution
are you available for hire?
Excellent video ! exactly what I need for POC. I realize that Chroma installation is a challenge with 'pip install chroma-migrate' and run `chroma-migrate` commands which crashed my Linux. Do you know of LTS version of Chroma?
Thank you for your comment! Can you let me know your python version? Can you try python 3.10 and then do a pip install chromadb?
@@AIAnytime I'm running Python 3.10.6 on Ubuntu 22.04.2
giving error ModuleNotFoundError: No module named 'pandas.core.arrays.arrow.dtype' please correct this code in ingest.py file
please hlp
Did you find a solution?
Yes I got it..
does this work on any language?
Thanks for your comment! No it doesn't work for any language.
have anyone ran it with 8GB RAM (CPU) windows laptop?
how much gb is LaMini file??
Does it means I only add data into the vectordb for new PDF, and no need to train again?
You have to create embeddings for the new files.
@AIAnytime got it. Thanks
Great tutorial, waiting for the chatbot ... and wp link is not working ,can you please share group link again ? Thank you!
Thanks Akshay! Please find it here: chat.whatsapp.com/EDnAeyBL18GB9xxcnyTW3Y The chatbot video will be posted by tomorrow.
@@AIAnytime can you share the link of that chatbot video here please regarding with this.
sir will it work on 8GB RAM
Difficult but it will for a few questions
This repo link please
please make it 10 millions pages
for lawyer use case