jskinner215 commited on
Commit
382ab41
·
1 Parent(s): 35b76d1

Update ui_utils.py

Browse files
Files changed (1) hide show
  1. ui_utils.py +8 -7
ui_utils.py CHANGED
@@ -49,14 +49,15 @@ def csv_upload_and_ingestion(client, selected_class):
49
  def display_query_input():
50
  question = st.text_input("Enter your question:", key="query_input")
51
 
52
- # Check if the question input is not empty
53
- if question:
54
  if st.button("Submit Query"):
55
- # Call function to query TAPAS with selected data and entered question
56
- query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model)
57
- elif st.session_state.get("csv_uploaded", False): # Check if CSV has been uploaded
58
- if st.button("Submit Query"):
59
- st.warning("Please provide a text query in the 'Enter your question:' input box to proceed.")
 
60
 
61
 
62
  def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):
 
49
  def display_query_input():
50
  question = st.text_input("Enter your question:", key="query_input")
51
 
52
+ # Display the "Submit Query" button if CSV has been uploaded
53
+ if st.session_state.get("csv_uploaded", False):
54
  if st.button("Submit Query"):
55
+ if question: # Check if the question input is not empty
56
+ # Call function to query TAPAS with selected data and entered question
57
+ query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model)
58
+ else:
59
+ st.warning("Please provide a text query in the 'Enter your question:' input box to proceed.")
60
+
61
 
62
 
63
  def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):