Spaces:
Build error
Build error
Commit ·
b53a860
1
Parent(s): bda63f0
Update ui_utils.py
Browse files71 unmodified lines7273747576777879808182838485868771 unmodified linesdef 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}")71 unmodified lines72737475767778798081828384858687888971 unmodified linesdef query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):# Embed the questionquestion_embedding = tapas_utils.embed_question(question)# Retrieve the most relevant tabletable = weaviate_utils.retrieve_relevant_table(client, selected_class, question_embedding)# 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+5-3