Simba
commited on
Commit
·
b4a3e90
1
Parent(s):
21e80f4
WIP
Browse files
app.py
CHANGED
@@ -26,9 +26,13 @@ def save_image_to_drive(image: np.ndarray) -> str:
|
|
26 |
|
27 |
|
28 |
|
29 |
-
def respond(image: np.ndarray, prompt: str, chat_history):
|
|
|
|
|
|
|
|
|
30 |
image = np.fliplr(image)
|
31 |
-
image = cv2.cvtColor(image, cv2.
|
32 |
image_path = save_image_to_drive(image)
|
33 |
response = connector.simple_prompt(image=image, prompt=prompt)
|
34 |
chat_history.append(((image_path,), None))
|
|
|
26 |
|
27 |
|
28 |
|
29 |
+
def respond(image: np.ndarray, prompt: str, chat_history=None):
|
30 |
+
# Initialize chat_history as an empty list if it's None
|
31 |
+
if chat_history is None:
|
32 |
+
chat_history = []
|
33 |
+
|
34 |
image = np.fliplr(image)
|
35 |
+
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
36 |
image_path = save_image_to_drive(image)
|
37 |
response = connector.simple_prompt(image=image, prompt=prompt)
|
38 |
chat_history.append(((image_path,), None))
|