Spaces:
Build error
Build error
Commit ·
cc87f36
1
Parent(s): 77a6da5
Update ui_utils.py
Browse files69 unmodified lines7071727374757677787980818283848586878889909169 unmodified linesst.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 searchdata = 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 formattable = 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 questionanswers = tapas_utils.ask_llm_chunk(tokenizer, model, table, [question])st.write(f"TAPAS answers: {answers}") # Logging data from TAPAS Answers# Display the answersfor answer in answers:st.write(f"Answer: {answer}")69 unmodified lines70717273747576777879808182838485868769 unmodified linesst.write(f"Selected class type: {type(selected_class)}, Value: {selected_class}")def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):# Embed the questionquestion_embedding = tapas_utils.embed_table(pd.DataFrame([question], columns=["Question"]))# Retrieve the most relevant tabletable = weaviate_utils.retrieve_relevant_table(client, selected_class, question_embedding)# Convert the table to TAPAS formattable = weaviate_utils.convert_to_tapas_format(table)# 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+8-12