Ganesh43 commited on
Commit
8c3c6aa
1 Parent(s): 1672ce6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -13,14 +13,14 @@ user_query = st.text_input("Enter your question:")
13
  uploaded_file = st.file_uploader("Upload a CSV file from Hugging Face Hub:", type="CSV")
14
 
15
  if uploaded_file is not None:
16
- # Extract file URL
17
- file_url = uploaded_file.url
18
 
19
  # Preprocess the CSV data
20
- context = preprocess_csv(file_url)
21
 
22
  # Display the uploaded CSV data as a table
23
- st.dataframe(context)
24
 
25
  else:
26
  # Use default context (optional)
 
13
  uploaded_file = st.file_uploader("Upload a CSV file from Hugging Face Hub:", type="CSV")
14
 
15
  if uploaded_file is not None:
16
+ # Read the CSV data using pandas
17
+ df = pd.read_csv(uploaded_file)
18
 
19
  # Preprocess the CSV data
20
+ context = preprocess_csv(df) # Assuming preprocess_csv can handle DataFrame input
21
 
22
  # Display the uploaded CSV data as a table
23
+ st.dataframe(df)
24
 
25
  else:
26
  # Use default context (optional)