1

Ok I'm really struggling to find clear documentation to help me understand what's going on here.

gen_events.append(shared.gradio['Generate'].click(
   ui.gather_interface_values, [shared.gradio[k] for k in shared.input_elements], shared.gradio['interface_state'])
.then(lambda x: (x, ''), shared.gradio['textbox'], [shared.gradio['Chat input'], shared.gradio['textbox']], show_progress=False)
.then(chat.generate_chat_reply_wrapper, shared.input_params, shared.gradio['display'], show_progress=False)
.then(chat.save_history, shared.gradio['mode'], None, show_progress=False)
   )

Really, I just need to know the interplay between the 'then' blocks. Are they operating independently? Or does the first function operate on the following inputs and then output as input to the next then block.. but then that doesn't make sense because the next first function operates on the following inputs, not on the output of the previous..

When I search syntax, the .then leads me to JS examples, but this is python which has it's own promise chain implementation so why this?

I don't know, I'd really appreciate some tips or links or anything. I don't think this is Gradio specific, but maybe it is?

0 Answers0