Spaces:
Build error
Build error
Commit ·
e26e61e
1
Parent(s): 382ab41
Update ui_utils.py
Browse files36 unmodified lines3738394041424344454647484950515236 unmodified linesdef csv_upload_and_ingestion(client, selected_class):csv_file = st.file_uploader("Upload a CSV file", type=["csv"], key="csv_uploader")if csv_file:if st.button("Confirm CSV upload"):# Call function to ingest CSV data into Weaviateweaviate_utils.ingest_data_to_weaviate(client, csv_file, selected_class)# Display a preview of the ingested datast.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 previewst.session_state.csv_uploaded = True # Set session state variabledef display_query_input():question = st.text_input("Enter your question:", key="query_input")# Display the "Submit Query" button if CSV has been uploaded36 unmodified lines373839404142434445464748495036 unmodified linesdef 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 lineif dataframe is not None: # Check if dataframe is returnedst.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 previewst.session_state.csv_uploaded = True # Set session state variabledef display_query_input(client, selected_class, tokenizer, model): # Added parametersquestion = st.text_input("Enter your question:", key="query_input")# Display the "Submit Query" button if CSV has been uploaded
ui_utils.py+8-10