Repository: gradio-app/gradio

Issue:
Add a guide on how to use blocks like regular python functions
- [x] I have searched to see if a similar issue already exists.


**Is your feature request related to a problem? Please describe.**  
As a gradio user, I wish there was a guide explaining how to use use a blocks app like a regular python function. Right now, it's only mentioned briefly for interfaces in the "Advanced Interfaces" [guide](https://gradio.app/advanced_interface_features/#loading-hugging-face-models-and-spaces) but there is no mention that this works for Blocks.

Some of our users are asking about this on discord

![image](https://user-images.githubusercontent.com/41651716/179055289-c0d9aaf8-d430-4d93-ae4e-1fbf5f7b2bc1.png)


**Describe the solution you'd like**  
A guide describing how to use blocks apps like regular python functions and how this relates to loading from hugging face spaces.

We should also add the `load` method to the documentation. 

**Additional context**  
Add any other context or screenshots about the feature request here.



Discussion:

Resolving patch:
diff --git a/demo/english_translator/run.py b/demo/english_translator/run.py
new file mode 100644
--- /dev/null
+++ b/demo/english_translator/run.py
@@ -0,0 +1,25 @@
+import gradio as gr
+
+from transformers import pipeline
+
+pipe = pipeline("translation", model="t5-base")
+
+
+def translate(text):
+    return pipe(text)[0]["translation_text"]
+
+
+with gr.Blocks() as demo:
+    with gr.Row():
+        with gr.Column():
+            english = gr.Textbox(label="English text")
+            translate_btn = gr.Button(value="Translate")
+        with gr.Column():
+            german = gr.Textbox(label="German Text")
+
+    translate_btn.click(translate, inputs=english, outputs=german)
+    examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
+                           inputs=[english])
+
+if __name__ == "__main__":
+    demo.launch()
\ No newline at end of file
diff --git a/demo/generate_english_german/run.py b/demo/generate_english_german/run.py
new file mode 100644
--- /dev/null
+++ b/demo/generate_english_german/run.py
@@ -0,0 +1,27 @@
+import gradio as gr
+
+from transformers import pipeline
+
+english_translator = gr.Blocks.load(name="spaces/freddyaboulton/english-translator")
+english_generator = pipeline("text-generation", model="distilgpt2")
+
+
+def generate_text(text):
+    english_text = english_generator(text)[0]["generated_text"]
+    german_text = english_translator(english_text)
+    return english_text, german_text
+
+
+with gr.Blocks() as demo:
+    with gr.Row():
+        with gr.Column():
+            seed = gr.Text(label="Input Phrase")
+        with gr.Column():
+            english = gr.Text(label="Generated English Text")
+            german = gr.Text(label="Generated German Text")
+    btn = gr.Button("Generate")
+    btn.click(generate_text, inputs=[seed], outputs=[english, german])
+    gr.Examples(["My name is Clara and I am"], inputs=[seed])
+
+if __name__ == "__main__":
+    demo.launch()
\ No newline at end of file
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -230,7 +230,7 @@ def skip() -> dict:
     return update()
 
 
-@document()
+@document("load")
 class Blocks(BlockContext):
     """
     Blocks is Gradio's low-level API that allows you to create more custom web
@@ -262,7 +262,7 @@ def update(name):
             btn.click(fn=update, inputs=inp, outputs=out)
 
         demo.launch()
-    Demos: blocks_hello, blocks_flipper, blocks_speech_text_length
+    Demos: blocks_hello, blocks_flipper, blocks_speech_text_length, generate_english_german
     """
 
     def __init__(
@@ -686,21 +686,19 @@ def load(
         For reverse compatibility reasons, this is both a class method and an instance
         method, the two of which, confusingly, do two completely different things.
 
-        Class method: loads a demo from a Hugging Face Spaces repo and creates it locally
-        Parameters:
-            name (str): the name of the model (e.g. "gpt2"), can include the `src` as prefix (e.g. "models/gpt2")
-            src (str | None): the source of the model: `models` or `spaces` (or empty if source is provided as a prefix in `name`)
-            api_key (str | None): optional api key for use with Hugging Face Hub
-            alias (str | None): optional string used as the name of the loaded model instead of the default name
-            type (str): the type of the Blocks, either a standard `blocks` or `column`
-        Returns: Blocks instance
-
-        Instance method: adds an event for when the demo loads in the browser.
+
+        Class method: loads a demo from a Hugging Face Spaces repo and creates it locally and returns a block instance.
+
+
+        Instance method: adds an event for when the demo loads in the browser and returns None.
         Parameters:
-            fn: Callable function
-            inputs: input list
-            outputs: output list
-        Returns: None
+            name: Class Method - the name of the model (e.g. "gpt2"), can include the `src` as prefix (e.g. "models/gpt2")
+            src: Class Method - the source of the model: `models` or `spaces` (or empty if source is provided as a prefix in `name`)
+            api_key: Class Method - optional api key for use with Hugging Face Hub
+            alias: Class Method - optional string used as the name of the loaded model instead of the default name
+            fn: Instance Method - Callable function
+            inputs: Instance Method - input list
+            outputs: Instance Method - output list
         """
         if isinstance(self_or_cls, type):
             if name is None:


Test patch: