Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -169,7 +169,9 @@ rag_chain = (
|
|
169 |
)
|
170 |
|
171 |
def get_response(query):
|
172 |
-
|
|
|
|
|
173 |
|
174 |
|
175 |
##############################################
|
@@ -368,13 +370,16 @@ if uploaded_image and recipe_submit:
|
|
368 |
openAIresponse = llm.invoke(openAICall)
|
369 |
print("AI CALL RESPONSE: ", openAIresponse.content)
|
370 |
|
|
|
371 |
RAGresponse = get_response(openAIresponse.content + " " + query)
|
372 |
-
print(RAGresponse)
|
373 |
with st.expander("Recipe Generation", expanded=True, icon=':material/menu_book:'):
|
374 |
st.title('Results: RAG')
|
375 |
# RAG the openai response and display
|
376 |
print("RAG INPUT", openAIresponse.content + " " + query)
|
|
|
377 |
display_response(RAGresponse)
|
|
|
378 |
elif uploaded_image is not None:
|
379 |
with st.expander("**Food Classification**", expanded=True, icon=':material/search_insights:'):
|
380 |
st.title("Results: Image Classification")
|
|
|
169 |
)
|
170 |
|
171 |
def get_response(query):
|
172 |
+
temp = rag_chain.invoke(query)
|
173 |
+
print("RAG RESPONSE TEMP: ", temp)
|
174 |
+
return temp
|
175 |
|
176 |
|
177 |
##############################################
|
|
|
370 |
openAIresponse = llm.invoke(openAICall)
|
371 |
print("AI CALL RESPONSE: ", openAIresponse.content)
|
372 |
|
373 |
+
print("AI CALL RESPONSE END")
|
374 |
RAGresponse = get_response(openAIresponse.content + " " + query)
|
375 |
+
print("RAGresponse: ", RAGresponse)
|
376 |
with st.expander("Recipe Generation", expanded=True, icon=':material/menu_book:'):
|
377 |
st.title('Results: RAG')
|
378 |
# RAG the openai response and display
|
379 |
print("RAG INPUT", openAIresponse.content + " " + query)
|
380 |
+
print("End rag input")
|
381 |
display_response(RAGresponse)
|
382 |
+
print("FINAL RAG RESPONSE", RAGresponse)
|
383 |
elif uploaded_image is not None:
|
384 |
with st.expander("**Food Classification**", expanded=True, icon=':material/search_insights:'):
|
385 |
st.title("Results: Image Classification")
|