Skip to content

Commit

Permalink
tutorial99
Browse files Browse the repository at this point in the history
  • Loading branch information
ronidas39 committed Jun 30, 2024
1 parent 7b8fcda commit b76bf39
Show file tree
Hide file tree
Showing 8 changed files with 11,946 additions and 0 deletions.
10,001 changes: 10,001 additions & 0 deletions tutorial99/bmw.csv

Large diffs are not rendered by default.

Binary file added tutorial99/cache/cache_db_0.10.db
Binary file not shown.
Binary file added tutorial99/cache/cache_db_0.10.db.wal
Binary file not shown.
29 changes: 29 additions & 0 deletions tutorial99/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import streamlit as st
from pandasai import SmartDataframe
from langchain_openai import ChatOpenAI
import pandas as pd

llm=ChatOpenAI(model="gpt-4o")
student_df=pd.read_csv(r"C:\Users\welcome\OneDrive\Documents\GitHub\LLMtutorial\tutorial99\students.csv")
student_sdf=SmartDataframe(student_df,config={"llm":llm})
bmw_df=pd.read_csv(r"C:\Users\welcome\OneDrive\Documents\GitHub\LLMtutorial\tutorial99\bmw.csv")
bmw_sdf=SmartDataframe(bmw_df,config={"llm":llm})

st.title("CHAT APP WITH MULTIPLE CSV")
options=["bmw","student"]
user_selection=st.selectbox("select your file",options)

if user_selection=="bmw":
input1=st.text_input("ask your question")
if input1 is not None:
btn1=st.button("submit")
if btn1:
response=bmw_sdf.chat(input1)
st.write(response)
elif user_selection=="student":
input2=st.text_input("ask your question")
if input2 is not None:
btn2=st.button("submit")
if btn2:
response=student_sdf.chat(input2)
st.write(response)
Loading

0 comments on commit b76bf39

Please sign in to comment.