Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,8 @@ model = AutoModelForCausalLM.from_pretrained("StanfordAIMI/CheXagent-8b", torch_
|
|
27 |
|
28 |
@spaces.GPU
|
29 |
def generate(image, prompt):
|
30 |
-
if hasattr(
|
31 |
-
image = Image.open(io.BytesIO(
|
32 |
else:
|
33 |
image = image
|
34 |
|
|
|
27 |
|
28 |
@spaces.GPU
|
29 |
def generate(image, prompt):
|
30 |
+
if hasattr(image, "read"):
|
31 |
+
image = Image.open(io.BytesIO(image.read())).convert("RGB")
|
32 |
else:
|
33 |
image = image
|
34 |
|