puzan789 commited on
Commit
e7540f3
·
1 Parent(s): a6ccbb2

Updated :Add

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -15,19 +15,19 @@ pipeline = QAPipeline()
15
  st.title("Recipe Q&A")
16
 
17
  # File upload section
18
- st.header("Upload CSV")
19
- uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
20
- if uploaded_file is not None:
21
- if st.button("Add Documents"):
22
- with tempfile.NamedTemporaryFile(delete=False, suffix=".csv") as tmp_file:
23
- tmp_file.write(uploaded_file.read())
24
- tmp_path = tmp_file.name
25
- loader = CSVLoader(file_path=tmp_path)
26
- data = loader.load()
27
- with st.spinner("Uploading documents..."):
28
- asyncio.run(pipeline.upload_documents(data))
29
- os.remove(tmp_path)
30
- st.success("Documents uploaded successfully.")
31
 
32
  # Query section
33
  st.header("Ask a Question")
 
15
  st.title("Recipe Q&A")
16
 
17
  # File upload section
18
+ # st.header("Upload CSV")
19
+ # uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
20
+ # if uploaded_file is not None:
21
+ # if st.button("Add Documents"):
22
+ # with tempfile.NamedTemporaryFile(delete=False, suffix=".csv") as tmp_file:
23
+ # tmp_file.write(uploaded_file.read())
24
+ # tmp_path = tmp_file.name
25
+ # loader = CSVLoader(file_path=tmp_path)
26
+ # data = loader.load()
27
+ # with st.spinner("Uploading documents..."):
28
+ # asyncio.run(pipeline.upload_documents(data))
29
+ # os.remove(tmp_path)
30
+ # st.success("Documents uploaded successfully.")
31
 
32
  # Query section
33
  st.header("Ask a Question")