Repository: gradio-app/gradio
Pull request: Promotes `postprocess` and `preprocess` to documented parameters
Makes `postprocess` and `preprocess` official and documented parameters for event triggers, since we've started to see questions that could be resolved by using these parameters (e.g. see #2283)

Also does the following:
* Noticed that some event triggers were missing some parameters, so this adds other missing parameters as well. 
* Deprecates `status_tracker` parameter
* Snuck in the documentation for the `grid` parameter in `Gallery.style` before I forget

Closes: #2283

Problem statement:
Accept `base64` strings as `value` for `gr.Image` and `gr.Gallery`
**Is your feature request related to a problem? Please describe.**  
I have a backend that returns base64 images. Converting them to PIL to have Gradio to convert them back to base64 seems a bit wasteful

**Describe the solution you'd like**  
Allow base64 strings as input - and do not process them when making them as an output too

Hints from issue discussion:
Hi @apolinario we could write some logic to detect if it's a base64 and not do any processing. But in this case, it might just be easier if you do something like this:

```py
import gradio as gr

with gr.Blocks() as demo:
    im = gr.Image()
    im.value = "data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/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TcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="

demo.launch()
```

or for the Gallery:

```py
import gradio as gr

with gr.Blocks() as demo:
    gallery = gr.Gallery()
    gallery.value = ["data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8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qmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="]

demo.launch()
```
I think this is going to be a rare case that a function returns a base64 representation, so I'm leaning against officially supporting it as a return type for the Image/Gallery/other media components. Instead the workaround above should suffice.

WDYT @aliabid94 @freddyaboulton?
Haven’t tested but can’t the same behavior be accomplished by disabling pre/post processing on the component? 
Yes, depending on how the component is being used, that's also an option. I was thinking that this is for statically displaying content, but if related to an event trigger, you can set `_postprocess=False` @apolinario 
Thank you @aliabd and @freddyaboulton ! In this case, the base64 image is coming from a backend in the function triggered by the Gradio action, so basically the user fills in the Gradio UI, presses "Run" and then a function is executed that calls an external backend and returns base64 images, so I need to get that as the `return` or output to a `gr.Gallery` - how can I use `_postprocess=False` in this context?
Can you share the code or the relevant code snippet @apolinario?
So the inference function looks something like this:

```py
def infer(prompt):        
    url = os.getenv('BACKEND_URL')
    payload = {'prompt': prompt}
    images_request = requests.post(url, json = payload)

    images = []
    for image in images_request.json()["images"]:
        #Each image is a base64 array. Currently I have to convert from base64 to PIL to return it to the gallery function 
        #just to then get it converted back to base64 when shown to the user
        image_decoded = Image.open(BytesIO(base64.b64decode(image)))t
        images.append(image_decoded)
    return images
```

And that is triggered by a 
```py
        btn.click(infer, inputs=text, outputs=gallery)
```
where gallery is just a `gr.Gallery`
All you need to do is change

```py
btn.click(infer, inputs=text, outputs=gallery)
```

to 

```py
btn.click(infer, inputs=text, outputs=gallery, _postprocess=False)
```

and it should work!
@freddyaboulton @aliabid94 thoughts on exposing `_preprocess` and `_postprocess` as proper parameters and documenting them? 
@apolinario did this work for you? Just a heads up, the `_preprocess` and `_postprocess` parameters might be promoted to official  parameters and renamed `preprocess` and `postprocess` in the next version of gradio

Commit message: added for grid

Patch to review:
diff --git a/demo/blocks_flag/run.py b/demo/blocks_flag/run.py
index 2083d39edf..a2579e0e73 100644
--- a/demo/blocks_flag/run.py
+++ b/demo/blocks_flag/run.py
@@ -27,7 +27,7 @@ def sepia(input_img, strength):
     strength.change(sepia, [img_input, strength], img_output)
     
     # We can choose which components to flag -- in this case, we'll flag all of them
-    btn.click(lambda *args: callback.flag(args), [img_input, strength, img_output], None, _preprocess=False)
+    btn.click(lambda *args: callback.flag(args), [img_input, strength, img_output], None, preprocess=False)
 
 if __name__ == "__main__":
     demo.launch()
diff --git a/gradio/blocks.py b/gradio/blocks.py
index 1da8d65c83..90190fe6cb 100644
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -492,8 +492,8 @@ def iterate_over_children(children_list):
                         dependency["status_tracker"]
                     ]
                 dependency["_js"] = dependency.pop("js", None)
-                dependency["_preprocess"] = False
-                dependency["_postprocess"] = False
+                dependency["preprocess"] = False
+                dependency["postprocess"] = False
 
                 for target in targets:
                     event_method = getattr(original_mapping[target], trigger)
diff --git a/gradio/components.py b/gradio/components.py
index 01cbd2db7a..62bede7870 100644
--- a/gradio/components.py
+++ b/gradio/components.py
@@ -1488,8 +1488,8 @@ def stream(
         outputs: List[Component],
         _js: Optional[str] = None,
         api_name: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
+        preprocess: bool = True,
+        postprocess: bool = True,
     ):
         """
         This event is triggered when the user streams the component (e.g. a live webcam
@@ -1509,8 +1509,8 @@ def stream(
             outputs,
             _js=_js,
             api_name=api_name,
-            _preprocess=_preprocess,
-            _postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
         )
 
 
@@ -1948,8 +1948,8 @@ def stream(
         outputs: List[Component],
         _js: Optional[str] = None,
         api_name: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
+        preprocess: bool = True,
+        postprocess: bool = True,
     ):
         """
         This event is triggered when the user streams the component (e.g. a live webcam
@@ -1971,8 +1971,8 @@ def stream(
             outputs,
             _js=_js,
             api_name=api_name,
-            _preprocess=_preprocess,
-            _postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
         )
 
     def style(
@@ -3291,7 +3291,7 @@ def postprocess(self, y: List[np.ndarray | PIL.Image | str] | None) -> List[str]
     def style(
         self,
         rounded: Optional[bool | Tuple[bool, bool, bool, bool]] = None,
-        grid: Optional[int | Tuple[int, int, int, int, int, int]] = None,
+        grid: Optional[int | Tuple] = None,
         height: Optional[str] = None,
         container: Optional[bool] = None,
     ):
@@ -3299,6 +3299,7 @@ def style(
         This method can be used to change the appearance of the gallery component.
         Parameters:
             rounded: If True, will round the corners. If a tuple, will round corners according to the values in the tuple, starting from top left and proceeding clock-wise.
+            grid: Represents the number of images that should be shown in one row, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). if fewer that 6 are given then the last will be used for all subsequent breakpoints
             height: Height of the gallery.
             container: If True, will place gallery in a container - providing some extra padding around the border.
         """
diff --git a/gradio/events.py b/gradio/events.py
index ffaf734539..a5df4cbcb9 100644
--- a/gradio/events.py
+++ b/gradio/events.py
@@ -19,9 +19,9 @@ def change(
         scroll_to_output: bool = False,
         show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the component's input value changes (e.g. when the user types in a textbox
@@ -36,10 +36,10 @@ def change(
             scroll_to_output: If True, will scroll to output component on completion
             show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "change",
             fn,
@@ -50,8 +50,8 @@ def change(
             scroll_to_output=scroll_to_output,
             show_progress=show_progress,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -67,9 +67,9 @@ def click(
         scroll_to_output: bool = False,
         show_progress: bool = True,
         queue=None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the component (e.g. a button) is clicked.
@@ -84,10 +84,10 @@ def click(
             scroll_to_output: If True, will scroll to output component on completion
             show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "click",
             fn,
@@ -99,8 +99,8 @@ def click(
             show_progress=show_progress,
             queue=queue,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
         )
 
 
@@ -115,9 +115,9 @@ def submit(
         scroll_to_output: bool = False,
         show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user presses the Enter key while the component (e.g. a textbox) is focused.
@@ -133,10 +133,10 @@ def submit(
             scroll_to_output: If True, will scroll to output component on completion
             show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "submit",
             fn,
@@ -147,8 +147,8 @@ def submit(
             scroll_to_output=scroll_to_output,
             show_progress=show_progress,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -160,10 +160,13 @@ def edit(
         inputs: List[Component],
         outputs: List[Component],
         api_name: AnyStr = None,
+        status_tracker: Optional[StatusTracker] = None,
+        scroll_to_output: bool = False,
+        show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user edits the component (e.g. image) using the
@@ -174,20 +177,26 @@ def edit(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
+            scroll_to_output: If True, will scroll to output component on completion
+            show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "edit",
             fn,
             inputs,
             outputs,
             api_name=api_name,
+            scroll_to_output=scroll_to_output,
+            show_progress=show_progress,
+            status_tracker=status_tracker,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -199,10 +208,13 @@ def clear(
         inputs: List[Component],
         outputs: List[Component],
         api_name: AnyStr = None,
+        status_tracker: Optional[StatusTracker] = None,
+        scroll_to_output: bool = False,
+        show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user clears the component (e.g. image or audio)
@@ -213,20 +225,26 @@ def clear(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
+            scroll_to_output: If True, will scroll to output component on completion
+            show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "submit",
             fn,
             inputs,
             outputs,
             api_name=api_name,
+            scroll_to_output=scroll_to_output,
+            show_progress=show_progress,
+            status_tracker=status_tracker,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -238,10 +256,13 @@ def play(
         inputs: List[Component],
         outputs: List[Component],
         api_name: AnyStr = None,
+        status_tracker: Optional[StatusTracker] = None,
+        scroll_to_output: bool = False,
+        show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user plays the component (e.g. audio or video).
@@ -252,20 +273,26 @@ def play(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
+            scroll_to_output: If True, will scroll to output component on completion
+            show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "play",
             fn,
             inputs,
             outputs,
             api_name=api_name,
+            scroll_to_output=scroll_to_output,
+            show_progress=show_progress,
+            status_tracker=status_tracker,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -275,10 +302,13 @@ def pause(
         inputs: List[Component],
         outputs: List[Component],
         api_name: Optional[AnyStr] = None,
+        status_tracker: Optional[StatusTracker] = None,
+        scroll_to_output: bool = False,
+        show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user pauses the component (e.g. audio or video).
@@ -289,20 +319,26 @@ def pause(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
+            scroll_to_output: If True, will scroll to output component on completion
+            show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "pause",
             fn,
             inputs,
             outputs,
             api_name=api_name,
+            scroll_to_output=scroll_to_output,
+            show_progress=show_progress,
+            status_tracker=status_tracker,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -312,10 +348,13 @@ def stop(
         inputs: List[Component],
         outputs: List[Component],
         api_name: AnyStr = None,
+        status_tracker: Optional[StatusTracker] = None,
+        scroll_to_output: bool = False,
+        show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user stops the component (e.g. audio or video).
@@ -326,20 +365,26 @@ def stop(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
+            scroll_to_output: If True, will scroll to output component on completion
+            show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.set_event_trigger(
             "stop",
             fn,
             inputs,
             outputs,
             api_name=api_name,
+            scroll_to_output=scroll_to_output,
+            show_progress=show_progress,
+            status_tracker=status_tracker,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
         )
 
@@ -351,11 +396,13 @@ def stream(
         inputs: List[Component],
         outputs: List[Component],
         api_name: AnyStr = None,
-        show_progress: bool = False,
+        status_tracker: Optional[StatusTracker] = None,
+        scroll_to_output: bool = False,
+        show_progress: bool = True,
         queue: Optional[bool] = None,
+        preprocess: bool = True,
+        postprocess: bool = True,
         _js: Optional[str] = None,
-        _preprocess: bool = True,
-        _postprocess: bool = True,
     ):
         """
         This event is triggered when the user streams the component (e.g. a live webcam
@@ -366,11 +413,14 @@ def stream(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
+            scroll_to_output: If True, will scroll to output component on completion
+            show_progress: If True, will show progress animation while pending
             queue: If True, will place the request on the queue, if the queue exists
+            preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
+            postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
         """
         # _js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
-        # _preprocess: If False, will not run preprocessing of component data before running 'fn'.
-        # _postprocess: If False, will not run postprocessing of component data before returning 'fn' output.
         self.streaming = True
         self.set_event_trigger(
             "stream",
@@ -378,9 +428,11 @@ def stream(
             inputs,
             outputs,
             api_name=api_name,
+            scroll_to_output=scroll_to_output,
+            show_progress=show_progress,
+            status_tracker=status_tracker,
             js=_js,
-            preprocess=_preprocess,
-            postprocess=_postprocess,
+            preprocess=preprocess,
+            postprocess=postprocess,
             queue=queue,
-            show_progress=False,
         )
diff --git a/gradio/examples.py b/gradio/examples.py
index 9e0bc6bd8b..f668e9ac3f 100644
--- a/gradio/examples.py
+++ b/gradio/examples.py
@@ -222,7 +222,7 @@ async def load_example(example_id):
                 inputs=[self.dataset],
                 outputs=self.inputs_with_examples
                 + (self.outputs if self.cache_examples else []),
-                _postprocess=False,
+                postprocess=False,
                 queue=False,
             )
             if self.run_on_click and not self.cache_examples:
diff --git a/gradio/interface.py b/gradio/interface.py
index b3ef4ad86b..689d461ba9 100644
--- a/gradio/interface.py
+++ b/gradio/interface.py
@@ -510,8 +510,8 @@ def render_flag_btns(flagging_options):
                         self.output_components,
                         api_name="predict",
                         status_tracker=status_tracker,
-                        _preprocess=not (self.api_mode),
-                        _postprocess=not (self.api_mode),
+                        preprocess=not (self.api_mode),
+                        postprocess=not (self.api_mode),
                     )
                 else:
                     for component in self.input_components:
@@ -522,8 +522,8 @@ def render_flag_btns(flagging_options):
                                     self.input_components,
                                     self.output_components,
                                     api_name="predict",
-                                    _preprocess=not (self.api_mode),
-                                    _postprocess=not (self.api_mode),
+                                    preprocess=not (self.api_mode),
+                                    postprocess=not (self.api_mode),
                                 )
                                 continue
                             else:
@@ -538,8 +538,8 @@ def render_flag_btns(flagging_options):
                                 self.input_components,
                                 self.output_components,
                                 api_name="predict",
-                                _preprocess=not (self.api_mode),
-                                _postprocess=not (self.api_mode),
+                                preprocess=not (self.api_mode),
+                                postprocess=not (self.api_mode),
                             )
             else:
                 submit_btn.click(
@@ -549,8 +549,8 @@ def render_flag_btns(flagging_options):
                     api_name="predict",
                     scroll_to_output=True,
                     status_tracker=status_tracker,
-                    _preprocess=not (self.api_mode),
-                    _postprocess=not (self.api_mode),
+                    preprocess=not (self.api_mode),
+                    postprocess=not (self.api_mode),
                 )
             clear_btn.click(
                 None,
@@ -612,7 +612,7 @@ def __call__(self, *flag_data):
                             flag_method,
                             inputs=flag_components,
                             outputs=[],
-                            _preprocess=False,
+                            preprocess=False,
                             queue=False,
                         )
 
@@ -640,7 +640,7 @@ def __call__(self, *flag_data):
                     outputs=interpretation_set
                     + [input_component_column, interpret_component_column],
                     status_tracker=status_tracker,
-                    _preprocess=False,
+                    preprocess=False,
                 )
 
             if self.article:


Code review comments:
diff_hunk: @@ -326,20 +365,26 @@ def stop(
             inputs: List of inputs
             outputs: List of outputs
             api_name: Defining this parameter exposes the endpoint in the api docs
+            status_tracker: StatusTracker to visualize function progress
path: gradio/events.py
text: @user1:
Do we have any examples of setting `status_tracker` ? Wondering if it will confuse users.

@author:
Yeah good point, @user2 maybe it would be good to have an example or demo with `StatusTracker`, since I'm not sure how it's supposed to be used myself

@user2:
No there's not really a good demo for it, I want to reconsider even having this argument.

@user2:
blocks_xray does use it I believe