Spaces:
Runtime error
Runtime error
fix method for converting image arr to PIL Image arr
Browse files- get_llava_response.py +2 -0
get_llava_response.py
CHANGED
|
@@ -124,6 +124,8 @@ def get_llava_response(user_prompts: list[str],
|
|
| 124 |
# image = load_image("../images/mouse.png") # previous method
|
| 125 |
if isinstance(img, np.ndarray) and len(img.shape) == 2:
|
| 126 |
img = Image.fromarray(img, 'L')
|
|
|
|
|
|
|
| 127 |
|
| 128 |
image = img.convert('RGB')
|
| 129 |
image_size = image.size
|
|
|
|
| 124 |
# image = load_image("../images/mouse.png") # previous method
|
| 125 |
if isinstance(img, np.ndarray) and len(img.shape) == 2:
|
| 126 |
img = Image.fromarray(img, 'L')
|
| 127 |
+
elif isinstance(img, np.ndarray):
|
| 128 |
+
img = Image.fromarray(img)
|
| 129 |
|
| 130 |
image = img.convert('RGB')
|
| 131 |
image_size = image.size
|