Spaces:
Build error
Build error
Commit ·
dffd9dd
1
Parent(s): 99b5e21
Update ui_utils.py
Browse files36 unmodified lines3738394041424344454041424344454647484950515236 unmodified lines
def csv_upload_and_ingestion(client, selected_class): csv_file = st.file_uploader("Upload a CSV file", type=["csv"], key="csv_uploader") if csv_file and st.button("Confirm CSV upload"): dataframe = weaviate_utils.ingest_data_to_weaviate(client, csv_file, selected_class) # Updated this line if dataframe is not None: # Check if dataframe is returned st.write(f"Your CSV was successfully integrated into the vector database under the class '{selected_class}'") st.write(dataframe.head()) # Display the first few rows of the dataframe as a preview st.session_state.csv_uploaded = True # Set session state variable if csv_file: if st.button("Confirm CSV upload"): # Call function to ingest CSV data into Weaviate dataframe = weaviate_utils.ingest_data_to_weaviate(client, csv_file, selected_class) # Updated this line if dataframe is not None: # Check if ingestion was successful # Display a preview of the ingested data st.write(f"Your CSV was successfully integrated into the vector database under the class '{selected_class}'") st.write(dataframe.head()) # Display the first few rows of the dataframe as a preview st.session_state.csv_uploaded = True # Set session state variable
def display_query_input(client, selected_class, tokenizer, model): # Added parameters question = st.text_input("Enter your question:", key="query_input")ui_utils.py+10-6