The answer how the client code is distributed to the client machines is neither answered nor asked yet.
BTW: "...the machine running the Gradio script" -- why do you assume that there is only a single script (not multiple copies on different machines) and only a single instance of it is being executed?