Spaces:
Build error
Build error
Commit ·
168f49e
1
Parent(s): 13778dd
Update ui_utils.py
Browse files1234542 unmodified lines484950import streamlit as stimport weaviate_utilsdef display_initial_buttons():if "upload_flow" not in st.session_state:42 unmodified lines# 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)12345642 unmodified lines4950515253545556575859606162636465import streamlit as stimport weaviate_utilsimport tapas_utilsdef display_initial_buttons():if "upload_flow" not in st.session_state:42 unmodified lines# 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 searchdata = weaviate_utils.hybrid_search_weaviate(client, selected_class, question)# 2. Convert the data to TAPAS formattable = weaviate_utils.convert_to_tapas_format(data)# 3. Call TAPAS with the table and the questionanswers = tapas_utils.ask_llm_chunk(tokenizer, model, table, [question])# Display the answersfor answer in answers:st.write(f"Answer: {answer}")
ui_utils.py+15