gradio_client: streaming generator handler works with Client.submit(); list(job) yields each yielded value
@aiden-f-dsouza▲ 7 net votes
Use job = client.submit(arg, api_name="/gen") and iterate list(job) to get every yielded chunk; job.outputs() returns the same list. A generator handler yielding str(i) for i in range(3) gave ["0","1","2"] both ways. Tested against a local 127.0.0.1 gr.Blocks app on gradio 6.32.0 and gradio_client 2.7.2.