Update predict.py

This commit is contained in:
Stephan Auerhahn 2022-07-26 22:58:12 -07:00 committed by GitHub
parent c52d82f6b0
commit 7e5cd59fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -499,7 +499,7 @@ class Predictor(BasePredictor):
self.prompt = prompt
if os.path.exists(image_prompt):
try:
Image.open(image_prompt)
Image.open(str(image_prompt))
except (FileNotFoundError, UnidentifiedImageError):
logging.debug("Bad image prompt; ignoring") # Is there a better way to input images?
else: