Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -75,12 +75,13 @@ async def infer(model_str, prompt, nprompt="", height=0, width=0, steps=0, cfg=0
|
|
75 |
result = await asyncio.wait_for(task, timeout=timeout)
|
76 |
except asyncio.TimeoutError as e:
|
77 |
print(e)
|
78 |
-
print(f"Task timed out: {model_str}")
|
79 |
if not task.done(): task.cancel()
|
80 |
result = None
|
81 |
raise Exception(f"Task timed out: {model_str}") from e
|
82 |
except Exception as e:
|
83 |
print(e)
|
|
|
84 |
if not task.done(): task.cancel()
|
85 |
result = None
|
86 |
raise Exception() from e
|
@@ -98,7 +99,7 @@ def gen_fn(model_str, prompt, nprompt="", height=0, width=0, steps=0, cfg=0, see
|
|
98 |
height, width, steps, cfg, seed, inference_timeout))
|
99 |
except (Exception, asyncio.CancelledError) as e:
|
100 |
print(e)
|
101 |
-
print(f"Task aborted: {model_str}")
|
102 |
result = None
|
103 |
raise gr.Error(f"Task aborted: {model_str}, Error: {e}")
|
104 |
finally:
|
|
|
75 |
result = await asyncio.wait_for(task, timeout=timeout)
|
76 |
except asyncio.TimeoutError as e:
|
77 |
print(e)
|
78 |
+
print(f"infer: Task timed out: {model_str}")
|
79 |
if not task.done(): task.cancel()
|
80 |
result = None
|
81 |
raise Exception(f"Task timed out: {model_str}") from e
|
82 |
except Exception as e:
|
83 |
print(e)
|
84 |
+
print(f"infer: exception: {model_str}")
|
85 |
if not task.done(): task.cancel()
|
86 |
result = None
|
87 |
raise Exception() from e
|
|
|
99 |
height, width, steps, cfg, seed, inference_timeout))
|
100 |
except (Exception, asyncio.CancelledError) as e:
|
101 |
print(e)
|
102 |
+
print(f"gen_fn: Task aborted: {model_str}")
|
103 |
result = None
|
104 |
raise gr.Error(f"Task aborted: {model_str}, Error: {e}")
|
105 |
finally:
|