Orami01 commited on
Commit
7778c4f
Β·
1 Parent(s): 1ad8ba9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -13
app.py CHANGED
@@ -15,17 +15,7 @@ st.title("Chat with CSV using open source LLM Inference Point πŸ¦™πŸ¦œ")
15
  # Display a markdown message with additional information
16
  st.markdown("<h3 style='text-align: center; color: white;'>Built by <a href='https://github.com/AIAnytime'>AI Anytime with ❀️ </a></h3>", unsafe_allow_html=True)
17
 
18
- # Allow users to upload a CSV file
19
- uploaded_file = st.sidebar.file_uploader("Upload your Data", type="csv")
20
-
21
- if uploaded_file :
22
- # Initialize the CSVLoader to load the uploaded CSV file
23
- #use tempfile because CSVLoader only accepts a file_path
24
- with tempfile.NamedTemporaryFile(delete=False) as tmp_file:
25
- tmp_file.write(uploaded_file.getvalue())
26
- tmp_file_path = tmp_file.name
27
-
28
- db = DB_FAISS_PATH = "vectorstore/db_faiss"
29
  # Initialize the CSVLoader to load the uploaded CSV file
30
  loader = CSVLoader(file_path="data/2019.csv", encoding="utf-8", csv_args={'delimiter': ','})
31
  data = loader.load()
@@ -115,8 +105,8 @@ qa = ConversationalRetrievalChain.from_llm(llm, retriever=docsearch.as_retriever
115
 
116
  # Insert a chat message container.
117
  with st.chat_message("user"):
118
- st.write("Hello πŸ‘‹")
119
- st.line_chart(np.random.randn(30, 3))
120
 
121
  # Display a chat input widget.
122
  st.chat_input("Say something")
 
15
  # Display a markdown message with additional information
16
  st.markdown("<h3 style='text-align: center; color: white;'>Built by <a href='https://github.com/AIAnytime'>AI Anytime with ❀️ </a></h3>", unsafe_allow_html=True)
17
 
18
+ loader = CSVLoader(file_path="data/2019.csv", encoding="utf-8", csv_args={"delimiter": ","})
 
 
 
 
 
 
 
 
 
 
19
  # Initialize the CSVLoader to load the uploaded CSV file
20
  loader = CSVLoader(file_path="data/2019.csv", encoding="utf-8", csv_args={'delimiter': ','})
21
  data = loader.load()
 
105
 
106
  # Insert a chat message container.
107
  with st.chat_message("user"):
108
+ st.write("Hello πŸ‘‹")
109
+ st.line_chart(np.random.randn(30, 3))
110
 
111
  # Display a chat input widget.
112
  st.chat_input("Say something")