Spaces:
Build error
Build error
Commit ·
d867f48
1
Parent(s): 5a6d9a0
Update ui_utils.py
Browse files40 unmodified lines41424344454647444849465051525354555051565758596061626340 unmodified lines 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(): question = st.text_input("Enter your question:") question = st.text_input("Enter your question:", key="query_input") # Check if the question input is not empty 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) query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model) elif st.session_state.get("csv_uploaded", False): # Check if CSV has been uploaded if 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 searchui_utils.py+13-4