Chat with CSV Streamlit Chatbot using Llama 2: All Open Source

Chat with CSV Streamlit Chatbot using Llama 2: All Open Source

AI Anytime

11 месяцев назад

47,846 Просмотров

In this exciting tutorial, I'll show you how to create your very own CSV Streamlit Chatbot using the powerful and open-source Llama 2 language model developed by Meta AI! The best part? It runs smoothly on a regular CPU machine, so no need for expensive hardware.

Throughout the video, I'll guide you step-by-step on building the chatbot, which can effortlessly retrieve information from a CSV file. To enhance its capabilities, we'll leverage sentence transformers for embeddings and utilize faiss CPU for efficient vector storage.

If you've ever wanted to dive into the world of chatbots and explore the potential of natural language processing, this tutorial is perfect for you. Join me and let's get hands-on with this exciting project!

Remember to like, comment, and subscribe to stay updated with more thrilling tutorials like this one. Happy coding!

AI Anytime's GitHub: https://github.com/AIAnytime
Previous Llama 2 Video (Medical Bot): https://youtu.be/kXuHxI5ZcG0
Streamlit Docs: https://docs.streamlit.io/
Llama 2 Model HF: https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML
Sentence Transformers Docs: https://huggingface.co/sentence-transformers
Langchain Docs: https://docs.langchain.com/docs/
LLM Playlist: https://www.youtube.com/playlist?list=PLrLEqwuz-mRIdlmvhddd7nGiNh8exqsBG
Streamlit Projects Playlist: https://www.youtube.com/playlist?list=PLrLEqwuz-mRJCRfUXQLCB8IFvHPlh7IjF
LinkedIn Account: https://www.linkedin.com/in/sonukr0/
WhatsApp Group of AI Anytime: https://chat.whatsapp.com/EDnAeyBL18GB9xxcnyTW3Y

#generativeai #coding #python

Тэги:

#llama2 #llama #meta_ai #generative_ai #llm #language_models #large_language_models #youtube #ai #langchain #huggingface
Ссылки и html тэги не поддерживаются


Комментарии:

Shobhit Agarwal
Shobhit Agarwal - 08.09.2023 06:54

I tried the same code and data file, but the results seems very inaccurate

Ответить
Malik Imran
Malik Imran - 02.09.2023 08:04

sir can you tell us how we can make csv and excel file reader and also give predictions on any type of excel and csv file and after this we will able to extract the information in the form of pdf means value able pdf with information and save to local system if you said to do this project private i will pay to you also! all think look this video but with openai means with openapi key! with also spech to text. I will "pay" for it!
Thanks

Ответить
Malik Imran
Malik Imran - 02.09.2023 08:03

sir can you tell us how we can make csv and excel file reader and also give predictions on any type of excel and csv file and after this we will able to extract the information in the form of pdf means value able pdf with information and save to local system if you said to do this project private i will pay to you also! all think look this video but with openai means with openapi key! with also spech to text. I will "pay" for it!
Thanks

Ответить
Pranav Harshan
Pranav Harshan - 02.09.2023 04:29

ModuleNotFoundError: No module named 'streamlit_chat' i get this error please help me

Ответить
Sohail Hosseini
Sohail Hosseini - 28.08.2023 23:41

Thanks for sharing!

Ответить
Adriano
Adriano - 24.08.2023 00:13

If I ask this chat What commands from the pandas python library to know China's GDP does it provide me with this type of information or not?

Ответить
Giridhar Reddy
Giridhar Reddy - 22.08.2023 06:12

Why we are not using CSV_Agent from the Langchain here , will it perform better than this

Ответить
Sarthak Kansal
Sarthak Kansal - 21.08.2023 16:38

I used your code as refrence and used llama 2 13B model for my CSVs, all the results I got were nonsensical. Then I used your exact code from github, it looked preetier but all the results were non-sense. Any guidance on how to improve accuracy?

Ответить
JP JB
JP JB - 20.08.2023 17:27

Too slow to be useable...nice idea.

Ответить
Hariharan Palani
Hariharan Palani - 20.08.2023 17:14

Your videos are very informative. I have a doubt to clarify regarding training the data. I have dataset in csv format which contains car details like name, brand, model, speification about car. One car information in a row with multiple columns. How to train this data in order for LLM to answer my questions like number of cars manufactured by TATA? etc...I see lot of examples using OpenAI. But when i try to use Llama2, the answers are not great. In this example also, when you ask number of countries available in 2019.csv, it is not giviing enough information. Can you please provide help to understand how to make LLM to work for these kind of data?

Ответить
McMarvin
McMarvin - 18.08.2023 09:55

Great video

Ответить
San Jose Dancewear and Costumes Capezio
San Jose Dancewear and Costumes Capezio - 17.08.2023 15:55

very good video, you don't beat around the bush, which i like very much concise and to the point. All of your examples show cpu what if we have gpu and would like to use it. What changes or the imports you will make to make it run on gpu and make it run faster. Please point out those elements in your videos. I remember compiling your code and notices one or two modules without gpu support. Please love to hear back from you

Ответить
Nysa Garg
Nysa Garg - 16.08.2023 09:23

Thank you so much for the video @aianytime! The app isn't running on my device tho. Its taking too much time to run

Ответить
Joshua Nishanth
Joshua Nishanth - 15.08.2023 12:19

Hi this is an amazing project but when I ran the same i get an error message stating 'Your app is having trouble loading the streamlit_chat.streamlit_chat component.' and I'm not sure why. Can you please help ?

Ответить
Maanya Jain
Maanya Jain - 15.08.2023 09:26

Hi, Thank you very much for this informative video and using an open source llm.
Could you please explain that how the LLM is retrieving the data from CSV. Does it have the knowledge of whole data uploaded by the user?

Ответить
Abhay Joshi
Abhay Joshi - 14.08.2023 16:35

Is the csv loaded to streamlit safe , thank you for your video amazing work

Ответить
Amit Kumar
Amit Kumar - 13.08.2023 22:42

1. Is there anything extra we need to do for running on GPU?
2. If I deploy my project, if 10 users search simultaneously. How the usage will be? will each user take up the entire RAM on cloud. How should I do for 1000s of users?

Ответить
Nery Guzman
Nery Guzman - 13.08.2023 10:19

I'm having problems trying out this on MacOs m1 chip :( it stays stuck after getting the query/question :(

Ответить
yash watwani
yash watwani - 11.08.2023 22:37

How can we show steps, like you showed in medical chatbot using chainlit

Ответить
Henk Hbit
Henk Hbit - 11.08.2023 00:05

Very informative, thanks for sharing.
When I try to run the code I get this error for model = "llama-2-7b-chat.ggmlv3.q8_0.bin": 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... Do I miss something?

Ответить
Gustavo Pelissaro
Gustavo Pelissaro - 10.08.2023 22:59

Hi, thanks for the video, very informative. I was thinking, can you show how you can do this exactly same thing but using Pandas Ai together with Llama2 instead of OpenAI? Thanks again

Ответить
Mallory Westwood
Mallory Westwood - 09.08.2023 06:39

May I know why you didn't use an Agent? For example instead of CSVLoader, could we have used create_csv_agent(llm, path) ? Trying to understand the difference.

Ответить
tushar arora
tushar arora - 08.08.2023 12:26

Also please make video on hosting this on Azure App service.....just a small 5 mins video

Ответить
tushar arora
tushar arora - 08.08.2023 12:04

Hi , i am getting correct answers from 2019.csv i asked what is the GDP of china? Answer : The GDP of china is not reported as it is not one of the countries listed in the context provided . IS there something i am doing wrong here

Ответить
DemoGPT
DemoGPT - 07.08.2023 17:32

I'm impressed with this video, and I want to thank you for your hard work. Have you thought about making a video about DemoGPT?

Ответить
Learning never ends with Changan
Learning never ends with Changan - 07.08.2023 15:52

It is taking 10 mins or for every response and response also not accurate. Is it same for all??

Ответить
Eleojo Emmanuel Adegbe
Eleojo Emmanuel Adegbe - 07.08.2023 01:44

Thank you for this video but i keep getting the error "You exceeded your current quota, please check your plan and billing details.... Why??

Ответить
Song82
Song82 - 06.08.2023 17:10

Where did you learn all this?

Ответить
Learning never ends with Changan
Learning never ends with Changan - 06.08.2023 06:08

I am seeing streamlit Running but notseeing any response in even 10 to 15 mins as well.. The response
takes longer time?

Ответить
Marcelo Lima
Marcelo Lima - 06.08.2023 02:37

In my case returns wrong answer 😛

Model: Llama 2 7B Chat
Question: Which actor made the movie with worse rating?
Answer: Based on the information provided, Michael Johnson made the movie with the worse rating, Movie C in 2018 with a rating of 6.8.
Correct Answer: Isabella Garcia,Movie L,2022,6.5

Data:
actor,movie,year,rating
John Doe,Movie A,2010,8.5
Jane Smith,Movie B,2015,7.9
Michael Johnson,Movie C,2018,6.8
Emily Brown,Movie D,2012,9.0
Robert Lee,Movie E,2019,8.2
Sophia Kim,Movie F,2014,7.3
William Chen,Movie G,2016,8.7
Olivia Wong,Movie H,2020,7.5
James Rodriguez,Movie I,2011,8.9
Ava Martinez,Movie J,2017,7.1
Liam Ramirez,Movie K,2013,9.2
Isabella Garcia,Movie L,2022,6.5
Ethan Nguyen,Movie M,2009,8.0
Mia Ali,Movie N,2013,7.6
Alexander Wilson,Movie O,2016,8.4
Sofia Anderson,Movie P,2018,7.8
Daniel Thomas,Movie Q,2021,8.3
Camila Hernandez,Movie R,2014,7.2
Joseph Scott,Movie S,2015,8.1
Victoria Lopez,Movie T,2019,7.4

Ответить
Learning never ends with Changan
Learning never ends with Changan - 05.08.2023 13:15

Can't we use 7B model from Meta for this?

Ответить
Marcelo Lima
Marcelo Lima - 05.08.2023 00:00

I ran the application on my machine. It worked perfectly =) Thank you.

Ответить
Rajiv Raghu
Rajiv Raghu - 04.08.2023 08:49

Excellent..Thanks for sharing

Ответить
A A
A A - 03.08.2023 02:49

Very nice and informative. If you can show how you deploy and create web versions that would be highly helpful.

Ответить
rakesh kumar rout
rakesh kumar rout - 02.08.2023 22:08

This is so informative and useful. Can you make a video for the same if you have pdfs and you have to make mcq questions and the answer should be like both a b or b c or c d likewise. Thank you

Ответить
kamalesh .G.S
kamalesh .G.S - 02.08.2023 10:53

you deserve more followers

Ответить
raji
raji - 01.08.2023 12:52

Excellent explaination can u explain how to connect to postgress database

Ответить
K.A.M. Show
K.A.M. Show - 01.08.2023 09:29

Thank you so much for information and tutorial ! you really help us all understand everything better.

Ответить
vijayendra bhati
vijayendra bhati - 31.07.2023 23:00

I can notice few countries in example dataset having GDP less than Chad. For example row 124 and 130. So what is the best possible way to get correct answer in this case.

Ответить
Mario Cuezzo
Mario Cuezzo - 31.07.2023 20:52

is much difficult to run it on GPU (if you have the required hardware)?

Ответить
xiaoyang feng
xiaoyang feng - 31.07.2023 16:22

why i could do not get the right answer?

Ответить
Prajwal G
Prajwal G - 31.07.2023 11:48

Why can't you fine tune llama2 and use

Ответить
Bruno Garcia Andrews
Bruno Garcia Andrews - 31.07.2023 06:29

My script will run and display no errors, bu nothing appears when I upload my csv file. Why might this be? Great video by the way. Thank you very much!

Ответить
Cesar Vega
Cesar Vega - 30.07.2023 21:20

Thanks for the information. I'm going to try it and I'll be telling you about it. Great job!

Ответить
cloudsystem
cloudsystem - 30.07.2023 17:36

Thank you for this awesome tutorial but how i can make it understand another language and respond to this language example Greek or German or Hindi ?

Ответить
Venkatesan Venkat
Venkatesan Venkat - 30.07.2023 16:38

Superrrr, thanks for your valuable content....

Ответить
Kitty Slayer
Kitty Slayer - 30.07.2023 16:38

I create character ai bot prompts and have a great business idea. I just dont know how to build these back end or gui. Let me know if you are intetested. Ill dm you a sample of one of my bots or if you have a discord.

Ответить
Vivek Neel
Vivek Neel - 30.07.2023 14:08

So what if I don't want to download the model and still reference it? Where do I need to deploy the model?

Ответить
Jegan Baskar
Jegan Baskar - 30.07.2023 14:07

Thank you for the detailed information. CSV loader works fine in single csv file however if i have a multiple csv's i tried with directory loader and see the accuracy of the result is very poor. we observed few more things during chunking process, its chunking every row and its loosing the context with previous row or aggregate the rows together. It would be good if you explain the chunking/embedding in more details. choosing the right chunking and embedding are very much important to get the accurate result. Keep doing the good work!!!

Ответить