Update app.py
Browse files
app.py
CHANGED
|
@@ -65,22 +65,25 @@ def app2_response(history,text,img):
|
|
| 65 |
|
| 66 |
def app1_query(img):
|
| 67 |
if not img:
|
| 68 |
-
|
|
|
|
| 69 |
base64 = image_to_base64(img)
|
| 70 |
data_url = f"data:image/jpeg;base64,{base64}"
|
| 71 |
-
|
| 72 |
-
return
|
| 73 |
|
| 74 |
# Function that takes User Inputs, generates Response and displays on Chat UI
|
| 75 |
def app1_response(img):
|
| 76 |
if not img:
|
| 77 |
response = txt_model.generate_content(txt_prompt_1)
|
| 78 |
-
|
|
|
|
| 79 |
|
| 80 |
else:
|
| 81 |
img = PIL.Image.open(img)
|
| 82 |
response = vis_model.generate_content([txt_prompt_1,img])
|
| 83 |
-
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
# Interface Code- Selector method
|
|
|
|
| 65 |
|
| 66 |
def app1_query(img):
|
| 67 |
if not img:
|
| 68 |
+
history += [(txt_prompt_1,None)]
|
| 69 |
+
return history
|
| 70 |
base64 = image_to_base64(img)
|
| 71 |
data_url = f"data:image/jpeg;base64,{base64}"
|
| 72 |
+
history += [(f" ", None)]
|
| 73 |
+
return history
|
| 74 |
|
| 75 |
# Function that takes User Inputs, generates Response and displays on Chat UI
|
| 76 |
def app1_response(img):
|
| 77 |
if not img:
|
| 78 |
response = txt_model.generate_content(txt_prompt_1)
|
| 79 |
+
history += [(None,response.text)]
|
| 80 |
+
return history
|
| 81 |
|
| 82 |
else:
|
| 83 |
img = PIL.Image.open(img)
|
| 84 |
response = vis_model.generate_content([txt_prompt_1,img])
|
| 85 |
+
history += [(None,response.text)]
|
| 86 |
+
return history
|
| 87 |
|
| 88 |
|
| 89 |
# Interface Code- Selector method
|