Spaces:
Build error
Build error
Commit ·
d867f48
1
Parent(s): 5a6d9a0
Update ui_utils.py
Browse files40 unmodified lines414243444546474849505152535440 unmodified linesif st.button("Confirm CSV upload"):# Call function to ingest CSV data into Weaviateweaviate_utils.ingest_data_to_weaviate(client, csv_file, selected_class)def display_query_input():question = st.text_input("Enter your question:")if question:if st.button("Submit Query"):# Call function to query TAPAS with selected data and entered question# (This function needs to be implemented)query_tapas_with_weaviate_data(st.session_state.data_source, question)def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):# 1. Perform hybrid search40 unmodified lines414243444546474849505152535455565758596061626340 unmodified linesif 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")# Check if the question input is not emptyif question:if st.button("Submit Query"):# Call function to query TAPAS with selected data and entered questionquery_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model)elif st.session_state.get("csv_uploaded", False): # Check if CSV has been uploadedif st.button("Submit Query"):st.warning("Please provide a text query in the 'Enter your question:' input box to proceed.")def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):# 1. Perform hybrid search
ui_utils.py+13-4