Spaces:
Build error
Build error
Commit ·
cc87f36
1
Parent(s): 77a6da5
Update ui_utils.py
Browse files69 unmodified lines70717273737576777879808182837475767778798081858682838485868769 unmodified lines st.write(f"Selected class type: {type(selected_class)}, Value: {selected_class}")
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) st.write(f"Data from Weaviate: {data}") # Logging data from Weaviate
# 2. Convert the data to TAPAS format table = weaviate_utils.convert_to_tapas_format(data) st.write(f"Data for TAPAS: {table}") # Logging data from TAPAS Table # 3. Call TAPAS with the table and the question # Embed the question question_embedding = tapas_utils.embed_table(pd.DataFrame([question], columns=["Question"])) # Retrieve the most relevant table table = weaviate_utils.retrieve_relevant_table(client, selected_class, question_embedding) # Convert the table to TAPAS format table = weaviate_utils.convert_to_tapas_format(table) # Call TAPAS with the table and the question answers = tapas_utils.ask_llm_chunk(tokenizer, model, table, [question]) st.write(f"TAPAS answers: {answers}") # Logging data from TAPAS Answers # Display the answers for answer in answers: st.write(f"Answer: {answer}")
ui_utils.py+8-12