Spaces:
Build error
Build error
Commit ·
168f49e
1
Parent(s): 13778dd
Update ui_utils.py
Browse files12345642 unmodified lines4950515253545556575859606162636465import streamlit as stimport weaviate_utilsimport tapas_utils
def 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 search data = weaviate_utils.hybrid_search_weaviate(client, selected_class, question)
# 2. Convert the data to TAPAS format table = weaviate_utils.convert_to_tapas_format(data)
# 3. Call TAPAS with the table and the question answers = tapas_utils.ask_llm_chunk(tokenizer, model, table, [question])
# Display the answers for answer in answers: st.write(f"Answer: {answer}")ui_utils.py+15