File size: 680 Bytes
d202a2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | """Repro: downstream workflow nodes still run after an upstream node fails.
Two bound functions are chained: `first` -> `second`. `first` always raises,
so `second` should never run. Instead, `second` executes with `None` as its
input: the canvas shows "got: None" on the node, and the server log prints
"second() called with None".
"""
import gradio as gr
def first(x: str) -> str:
raise ValueError("boom")
def second(x: str) -> str:
print(f"second() called with {x!r}")
return f"got: {x}"
wf = gr.Workflow(
graph="workflow.json",
bind={"first": first, "second": second},
edges=[("first", "second")],
)
if __name__ == "__main__":
wf.launch()
|