Spaces:
Build error
Build error
Commit ·
e26e61e
1
Parent(s): 382ab41
Update ui_utils.py
Browse files36 unmodified lines37383940414243444546474849404142434445464748495036 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: if st.button("Confirm CSV upload"): # Call function to ingest CSV data into Weaviate weaviate_utils.ingest_data_to_weaviate(client, csv_file, selected_class) # 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(): 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
def display_query_input(client, selected_class, tokenizer, model): # Added parameters question = st.text_input("Enter your question:", key="query_input") # Display the "Submit Query" button if CSV has been uploadedui_utils.py+8-10