Search Your PDF App using Langchain, ChromaDB, and Open Source LLM: No OpenAI API (Runs on CPU)
HTML-код
- Опубликовано: 25 июн 2023
- 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/AIAnytime
LaMiNi LM Model: huggingface.co/MBZUAI/LaMini-...
ChromaDB: www.trychroma.com/
Langchain: python.langchain.com/docs/get...
LLM Playlist: • Large Language Models
Join WhatsApp: chat.whatsapp.com/EDnAeyBL18G..
#langchain #python #ai - Наука
You are a blessing my guy. Amazing, thanks for taking your time and teaching this. Truly Appreciate your efforts.
Instructive and thorough, appreicate your efforts!
Thank you Sir, please consider subscribing to the channel.
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.
I'm glad that I found your channel brother 🙌❤
Welcome aboard! Thanks. Plz keep supporting.
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
Too much great working
Thanks alot
I learned alot. I will try doiing this tutorial.
Glad it was helpful!
Superb video. So easy to follow...
Thanks a lot 😊
Very well explained video, and nice content. Congratulations!
Thanks a lot!
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 video
Awesome!
Thank you! Cheers!
Super awesome tutorial! I wonder if you want to search pdfs in folders and subfolders.. what would be the code for that?
great vid!
Thank you.
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
Awesome video... can you pls suggest any model for querying the Portuguese PDF document ?
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?
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
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.
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.
Thank you for the awesome video. With the source citation does it also give images from the pdf in the answer?
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
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?
I think if we ask general questions lik “who is naredra modi?” It will answer out of the pdf files
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?
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
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.
Is it possible to change "all-MiniLM-L6-v2" per Watson LLM or any other paid LLM?
How to deploy this RAG model in aws. I mean what services we can use to deploy other than EC2?
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.
What if we ask a question that is not from PDF?
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?
PLEASE TELL ME THE SYSTEM CONFUGURATION REQUIRED FOR THIS....
I HAVE DONE BUT SHOWING Load_weight proeblem
Doesnt work getting crazzy error with embdeggins both with huggingfqce a d sentence transformer
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
@AIAnytime can we get the images also from pdf in answer ?
Many people’s build like this but there is no solution to restrict the model to answer only for pdf files
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
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 RUclips. 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
'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?
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.
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 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.
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.
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?
what python version are you using?
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.
I am getting this error - " AttributeError: 'Collection' object has no attribute '__pydantic_extra__' " why?
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 we also give large files as input file (1000 pages)
how can we do this with knowledge graph ?
Please consider investing in a microphone thst will enhance the quality of audio in the videos
Sure sir
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
how much gb is LaMini file??
can you mention the version of python you are using here?
how to solve this AttributeError: 'Client' object has no attribute 'chroma_api_impl'?
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.
hi cannot install chromadb --error failed
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 RUclips banner.
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
I am getting this error
NotImplementedError: Cannot copy out of meta tensor; no data!
Any work arounds?
Did you find a solution?
AttributeError: chroma_api_impl
can you help me fix this please
How to connect you?The whatsapp link does not working...
Bookmark: 21:00
Can i use falcon 40b in the place that llm u r using???
Ofcourse you can. Make sure you have enough compute power.
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 ?
what about supabase for vector store?
That's a good choice.
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
PDF file of resume is not output.
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
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.
The kid smoking in the background distracted me 😂
please make it 10 millions pages
for lawyer use case
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.
This repo link please
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
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?
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
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
are you available for hire?
Chroma db error your using a deprecated configuration of chromo, some migrate
same error with me how come do you solve this
have anyone ran it with 8GB RAM (CPU) windows laptop?
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
Which extension are you using for auto completion of code??
Tabnine.
@@AIAnytime Thank you ✌️
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 🙂
where is code link??
Code please, gone through your git hub, could'nt able to find
Please find it here: github.com/AIAnytime/Search-Your-PDF-App . Can you please subscribe to the channel?
does this work on any language?
Thanks for your comment! No it doesn't work for any language.
Whatsapp link not working
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..
Really awsome. How do I reach you?
Thank you! Look at RUclips Banner on my channel. All social media are listed. Or about the channel section.
ValueError: You are using a deprecated configuration of Chroma.
Downgrade chromadb version
pip uninstall chromadb
pip install chromadb==0.3.29
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
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
sir will it work on 8GB RAM
Difficult but it will for a few questions
When I use any app first I see it suffers from the hallucinations or not but this is good no hallucinations
I agree with you! Thank you.
To my knowledge, all large language models are susceptible to hallucination. Your methodology seems flawed.
Hi Tenly, thanks for your message. I have used a language model. It's not that large. It generalises well on the embeddings that we create! When you use LLMs which are too large, they don't generalise well on the documents that you so it hallucinates from the base models.
Can you try this and let me know if you get high hallucinations rate? You can't remove that character but LaMiNi really helps on the hallucinations rate.
@@AIAnytime I’m only 13 minutes into your video(and still watching), but my comment was directed to the person who said they “test for hallucinations” before anything else - but I can’t imagine what kind of tests he could perform to conclude that a model doesn’t hallucinate.
Half knowledge
muy pero que muy mal explicado... abres la IDE con muchas cosas que no sabemos de donde salen.
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