Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -516,16 +516,17 @@ if recipe_submit and uploaded_image:
|
|
516 |
),
|
517 |
]
|
518 |
with col2:
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
|
|
529 |
|
530 |
# elif uploaded_image is not None:
|
531 |
# with col1:
|
@@ -552,9 +553,10 @@ if recipe_submit and uploaded_image:
|
|
552 |
|
553 |
elif recipe_submit and query:
|
554 |
with col2:
|
555 |
-
|
556 |
-
|
557 |
-
|
|
|
558 |
else:
|
559 |
st.warning('Please input an image or a query.', icon="π")
|
560 |
|
|
|
516 |
),
|
517 |
]
|
518 |
with col2:
|
519 |
+
with st.spinner():
|
520 |
+
if query:
|
521 |
+
# Call the OpenAI API
|
522 |
+
openAIresponse = llm.invoke(openAICall)
|
523 |
+
print("AI CALL RESPONSE: ", openAIresponse.content, "END AI CALL RESONSE")
|
524 |
+
|
525 |
+
RAGresponse = get_response(openAIresponse.content + " " + query)
|
526 |
+
else:
|
527 |
+
RAGresponse = get_response(predictions[0][0])
|
528 |
+
print("RAGresponse: ", RAGresponse)
|
529 |
+
display_response(RAGresponse)
|
530 |
|
531 |
# elif uploaded_image is not None:
|
532 |
# with col1:
|
|
|
553 |
|
554 |
elif recipe_submit and query:
|
555 |
with col2:
|
556 |
+
with st.spinner():
|
557 |
+
response = get_response(query)
|
558 |
+
print(response)
|
559 |
+
display_response(response)
|
560 |
else:
|
561 |
st.warning('Please input an image or a query.', icon="π")
|
562 |
|