error handling

This commit is contained in:
Vladimir Mandic
2024-02-13 09:17:01 -05:00
parent f5c1cb1bae
commit 1bcaa77dc5
7 changed files with 12 additions and 6 deletions
+2
View File
@@ -98,6 +98,8 @@ class Unit(): # mashup of gradio controls and mapping to actual implementation c
self.adain_weight = c4
def upload_image(image_file):
if image_file is None:
return gr.update(value=None)
try:
self.process.override = Image.open(image_file.name)
self.override = self.process.override