Spaces:
Build error
Build error
Commit ·
dffd9dd
1
Parent(s): 99b5e21
Update ui_utils.py
Browse files36 unmodified lines37383940414243444546474836 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")36 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 Weaviatedataframe = weaviate_utils.ingest_data_to_weaviate(client, csv_file, selected_class) # Updated this lineif dataframe is not None: # Check if ingestion was successful# 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(client, selected_class, tokenizer, model): # Added parametersquestion = st.text_input("Enter your question:", key="query_input")
ui_utils.py+10-6