Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,9 @@ def ImageStory(image: Union[np.ndarray, str, IO]) -> str:
|
|
24 |
|
25 |
# check image file and convert to a PIL image
|
26 |
if isinstance(image, np.ndarray):
|
27 |
-
img = Image.fromarray(image)
|
28 |
else:
|
29 |
-
img = Image.open(image)
|
30 |
|
31 |
response = model.generate_content(["write a short story about the image", img])
|
32 |
|
|
|
24 |
|
25 |
# check image file and convert to a PIL image
|
26 |
if isinstance(image, np.ndarray):
|
27 |
+
img = PIL.Image.fromarray(image)
|
28 |
else:
|
29 |
+
img = PIL.Image.open(image)
|
30 |
|
31 |
response = model.generate_content(["write a short story about the image", img])
|
32 |
|