Spaces:
Build error
Build error
Commit
·
b53a860
1
Parent(s):
bda63f0
Update ui_utils.py
Browse files- ui_utils.py +5 -3
ui_utils.py
CHANGED
@@ -72,16 +72,18 @@ def display_query_input(client, selected_class, tokenizer, model): # Added para
|
|
72 |
|
73 |
def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):
|
74 |
# Embed the question
|
75 |
-
question_embedding = tapas_utils.
|
|
|
76 |
# Retrieve the most relevant table
|
77 |
table = weaviate_utils.retrieve_relevant_table(client, selected_class, question_embedding)
|
78 |
-
|
79 |
-
table = weaviate_utils.convert_to_tapas_format(table)
|
80 |
# Call TAPAS with the table and the question
|
81 |
answers = tapas_utils.ask_llm_chunk(tokenizer, model, table, [question])
|
|
|
82 |
# Display the answers
|
83 |
for answer in answers:
|
84 |
st.write(f"Answer: {answer}")
|
85 |
|
86 |
|
87 |
|
|
|
|
72 |
|
73 |
def query_tapas_with_weaviate_data(client, selected_class, question, tokenizer, model):
|
74 |
# Embed the question
|
75 |
+
question_embedding = tapas_utils.embed_question(question)
|
76 |
+
|
77 |
# Retrieve the most relevant table
|
78 |
table = weaviate_utils.retrieve_relevant_table(client, selected_class, question_embedding)
|
79 |
+
|
|
|
80 |
# Call TAPAS with the table and the question
|
81 |
answers = tapas_utils.ask_llm_chunk(tokenizer, model, table, [question])
|
82 |
+
|
83 |
# Display the answers
|
84 |
for answer in answers:
|
85 |
st.write(f"Answer: {answer}")
|
86 |
|
87 |
|
88 |
|
89 |
+
|