internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: gradio-app/gradio

Issue:
Allow input-less and output-less interfaces
**Is your feature request related to a problem? Please describe.**
Sometimes, I want to create an interface without an input (such as for GANs) or without outputs (for crowd-sourced dataset generation). Internal Slack discussion https://huggingface.slack.com/archives/C02QZLG8GMN/p1647601809063159

**Describe the solution you'd like**
Allowign something like `gr.Interface(fn=fn, outputs="image")`




Discussion:

Resolving patch:
diff --git a/demo/no_input/run.py b/demo/no_input/run.py
new file mode 100644
--- /dev/null
+++ b/demo/no_input/run.py
@@ -0,0 +1,16 @@
+import gradio as gr
+import random
+
+sentence_list = [
+    "Good morning!",
+    "Prayers are with you, have a safe day!",
+    "I love you!"
+]
+
+
+def random_sentence():
+    return sentence_list[random.randint(0, 2)]
+
+
+demo = gr.Interface(fn=random_sentence, outputs="text")
+demo.launch()
diff --git a/gradio/interface.py b/gradio/interface.py
--- a/gradio/interface.py
+++ b/gradio/interface.py
@@ -172,6 +172,11 @@ def __init__(
         """
         super().__init__(analytics_enabled=analytics_enabled, mode="interface")
 
+        if inputs is None:
+            inputs = []
+        if outputs is None:
+            outputs = []
+
         if not isinstance(fn, list):
             fn = [fn]
         if not isinstance(inputs, list):


Test patch:
Repository: gradio-app/gradio

Issue:
handle custom styling for interfaces in the frontend rather than in the python lib
At the minute we are injecting custom CSS to create the interface design. Ideally we would not need to do this and would use either some new layout components (`Panel`, etc.) or custom CSS properties to modify the components we are using.

The current approach makes the dev experience very tedious, when modifying the interface styling.


Discussion:

Resolving patch:
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -158,15 +158,23 @@ def get_template_context(self):
 
 
 class Column(BlockContext):
-    def __init__(self, visible: bool = True, css: Optional[Dict[str, str]] = None):
+    def __init__(
+        self,
+        visible: bool = True,
+        css: Optional[Dict[str, str]] = None,
+        variant: str = "default",
+    ):
         """
         css: Css rules to apply to block.
+        variant: column type, 'default' (no background) or 'panel' (gray background color and rounded corners)
         """
+        self.variant = variant
         super().__init__(visible, css)
 
     def get_template_context(self):
         return {
             "type": "column",
+            "variant": self.variant,
             **super().get_template_context(),
         }
 
diff --git a/gradio/interface.py b/gradio/interface.py
--- a/gradio/interface.py
+++ b/gradio/interface.py
@@ -468,13 +468,7 @@ def clean_html(raw_html):
                     self.InterfaceTypes.INPUT_ONLY,
                     self.InterfaceTypes.UNIFIED,
                 ]:
-                    with Column(
-                        css={
-                            "background-color": "rgb(249,250,251)",
-                            "padding": "0.5rem",
-                            "border-radius": "0.5rem",
-                        }
-                    ):
+                    with Column(variant="panel"):
                         input_component_column = Column()
                         if self.interface_type in [
                             self.InterfaceTypes.INPUT_ONLY,
@@ -516,13 +510,7 @@ def clean_html(raw_html):
                     self.InterfaceTypes.OUTPUT_ONLY,
                 ]:
 
-                    with Column(
-                        css={
-                            "background-color": "rgb(249,250,251)",
-                            "padding": "0.5rem",
-                            "border-radius": "0.5rem",
-                        }
-                    ):
+                    with Column(variant="panel"):
                         status_tracker = StatusTracker(cover_container=True)
                         for component in self.output_components:
                             component.render()


Test patch:
Repository: gradio-app/gradio

Issue:
implement `change` event for individual `TabItem`s
Implemented on the backend, not the front.

Note: maybe change the name to `show`, `load`, `select`.

@abidlabs any thoughts on the name?


Discussion:
No strong opinion. Maybe `select()` because the event happens when the tab item is selected

Resolving patch:
diff --git a/demo/blocks_xray/run.py b/demo/blocks_xray/run.py
--- a/demo/blocks_xray/run.py
+++ b/demo/blocks_xray/run.py
@@ -27,7 +27,7 @@ def ct_model(diseases, img):
     )
 
     with gr.Tabs():
-        with gr.TabItem("X-ray"):
+        with gr.TabItem("X-ray") as x_tab:
             with gr.Row():
                 xray_scan = gr.Image()
                 xray_results = gr.JSON()
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -202,7 +202,7 @@ def __init__(
     def get_template_context(self):
         return {"label": self.label, **super().get_template_context()}
 
-    def change(self, fn: Callable, inputs: List[Component], outputs: List[Component]):
+    def select(self, fn: Callable, inputs: List[Component], outputs: List[Component]):
         """
         Parameters:
             fn: Callable function
@@ -210,7 +210,7 @@ def change(self, fn: Callable, inputs: List[Component], outputs: List[Component]
             outputs: List of outputs
         Returns: None
         """
-        self.set_event_trigger("change", fn, inputs, outputs)
+        self.set_event_trigger("select", fn, inputs, outputs)
 
 
 class BlockFunction:


Test patch:
Repository: gradio-app/gradio

Issue:
Blowfish is deprecated
### Describe the bug

When launching a block, I get warnings about `Blowfish` being deprecated

### Reproduction

```py
!pip install --quiet gradio==2.9.0b9
import gradio as gr

demo = gr.Blocks()

with demo:
  with gr.Tabs():
    with gr.TabItem("Text"):
      gr.Interface(lambda x:x, "text", "text")
    with gr.TabItem("Image"):
      gr.Interface(lambda x:x, "image", "image")      

demo.launch()
```

### Screenshot

_No response_

### Logs

```shell
/usr/local/lib/python3.7/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,
```


### System Info

```shell
Gradio 2.9.0b9, colab or spaces
```


### Severity

annoyance


Discussion:

Resolving patch:
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -238,7 +238,7 @@ def __init__(
         theme: str = "default",
         analytics_enabled: Optional[bool] = None,
         mode: str = "blocks",
-        enable_queue: bool = False,
+        enable_queue: bool = None,
         **kwargs,
     ):
 
diff --git a/gradio/processing_utils.py b/gradio/processing_utils.py
--- a/gradio/processing_utils.py
+++ b/gradio/processing_utils.py
@@ -126,7 +126,12 @@ def resize_and_crop(img, size, crop_type="center"):
 
 
 def audio_from_file(filename, crop_min=0, crop_max=100):
-    audio = AudioSegment.from_file(filename)
+    try:
+        audio = AudioSegment.from_file(filename)
+    except FileNotFoundError as e:
+        error_message = str(e)
+        if "ffprobe" in error_message:
+            print("Please install `ffmpeg` in your system to use non-WAV audio file formats.")
     if crop_min != 0 or crop_max != 100:
         audio_start = len(audio) * crop_min / 100
         audio_end = len(audio) * crop_max / 100
diff --git a/gradio/tunneling.py b/gradio/tunneling.py
--- a/gradio/tunneling.py
+++ b/gradio/tunneling.py
@@ -10,7 +10,11 @@
 import warnings
 from io import StringIO
 
-import paramiko
+from cryptography.utils import CryptographyDeprecationWarning
+
+with warnings.catch_warnings():
+    warnings.filterwarnings("ignore", category=CryptographyDeprecationWarning)
+    import paramiko
 
 
 def handler(chan, host, port):


Test patch:
Repository: gradio-app/gradio

Issue:
[blocks] show queue position, eta, and current duration with loading status
This finalises the loading status, requires some refactoring


Discussion:
We should also make sure that the loading animation is appropriate for all of the components. I love the design, but we might need to tweak it for the smaller components

Resolving patch:
diff --git a/demo/fake_gan/run.py b/demo/fake_gan/run.py
--- a/demo/fake_gan/run.py
+++ b/demo/fake_gan/run.py
@@ -24,6 +24,8 @@ def fake_gan(count, *args):
     return images
 
 
+cheetah = os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg")
+
 demo = gr.Interface(
     fn=fake_gan,
     inputs=[
@@ -38,21 +40,22 @@ def fake_gan(count, *args):
     title="FD-GAN",
     description="This is a fake demo of a GAN. In reality, the images are randomly chosen from Unsplash.",
     examples=[
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
-        [os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
+        [2, cheetah, 12, 12, 4, 4],
     ],
+    enable_queue=True,
 )
 
 if __name__ == "__main__":


Test patch:
Repository: gradio-app/gradio

Issue:
form groups broken when in a row
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

Form groups are broken when in a row, rather than a column. This just hadn't been accounted for.

https://github.com/gradio-app/gradio/issues/690#issuecomment-1119351175

### Reproduction

-

### Screenshot

_No response_

### Logs

_No response_

### System Info

```shell
-
```


### Severity

critical


Discussion:

Resolving patch:
diff --git a/demo/blocks_layout/run.py b/demo/blocks_layout/run.py
new file mode 100644
--- /dev/null
+++ b/demo/blocks_layout/run.py
@@ -0,0 +1,31 @@
+import gradio as gr
+
+
+demo = gr.Blocks()
+
+with demo:
+    with gr.Row():
+        gr.Image(interactive=True)
+        gr.Image()
+    with gr.Row():
+        gr.Textbox(label="Text")
+        gr.Number(label="Count")
+        gr.Radio(choices=["One", "Two"])
+    with gr.Row():
+        with gr.Row():
+            with gr.Column():
+                gr.Textbox(label="Text")
+                gr.Number(label="Count")
+                gr.Radio(choices=["One", "Two"])
+            gr.Image()
+            with gr.Column():
+                gr.Image(interactive=True)
+                gr.Image()
+    gr.Image()
+    gr.Textbox(label="Text")
+    gr.Number(label="Count")
+    gr.Radio(choices=["One", "Two"])
+
+
+if __name__ == "__main__":
+    demo.launch()


Test patch:
Repository: gradio-app/gradio

Issue:
[digit_classifier] Image Source Canvas Style 
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

Image as input source canvas overflow issues

### Reproduction

Test Notebook
https://colab.research.google.com/drive/1epV1ILJZMN6BrtizIpcD4sjqDclUSoty?usp=sharing

Demo from
https://github.com/gradio-app/gradio/blob/main/demo/digit_classifier/run.py

### Screenshot


https://user-images.githubusercontent.com/102277/168143672-e4fd7e36-caa4-4049-8b4e-352153024f45.mov



### Logs

_No response_

### System Info

```shell
3.0b0
```


### Severity

critical


Discussion:

Resolving patch:
diff --git a/gradio/blocks.py b/gradio/blocks.py
--- a/gradio/blocks.py
+++ b/gradio/blocks.py
@@ -171,6 +171,11 @@ def update(
             "__type__": "update",
         }
 
+    def style(self, equal_height: Optional[bool] = None):
+        if equal_height is not None:
+            self._style["equal_height"] = equal_height
+        return self
+
 
 class Column(BlockContext):
     def __init__(
diff --git a/gradio/interface.py b/gradio/interface.py
--- a/gradio/interface.py
+++ b/gradio/interface.py
@@ -467,7 +467,7 @@ def clean_html(raw_html):
                 )
             if self.description:
                 Markdown(self.description)
-            with Row():
+            with Row().style(equal_height=False):
                 if self.interface_type in [
                     self.InterfaceTypes.STANDARD,
                     self.InterfaceTypes.INPUT_ONLY,


Test patch:
Repository: gradio-app/gradio

Issue:
3.0b8 gr.inputs.Radio linkage problem
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

I am using `gr.inputs.Radio` in gradio v3.0b8, and found that there is a linkage problem in different radio inputs. I made a demo:

```python
# gradio 3.0b8
import gradio as gr

def greet(name):
    return "Hello " + name + "!!"


inputs_device = gr.inputs.Radio(choices=["cuda:0", "cpu"], default="cuda:0", label="设备")
inputs_size = gr.inputs.Radio(choices=[320, 640, 1280], default=320, label="推理尺寸")

iface = gr.Interface(fn=greet, inputs=[inputs_device, inputs_size], outputs="text")
iface.launch()
```

### Reproduction

![ksnip_20220516-170025](https://user-images.githubusercontent.com/41098760/168557175-adeadb63-832d-49dd-8d92-f0a857609f79.png)
![ksnip_20220516-170031](https://user-images.githubusercontent.com/41098760/168557189-e2746fa3-cd6d-4980-b81b-9b5ea2415f91.png)



### Screenshot

_No response_

### Logs

_No response_

### System Info

```shell
gradio 3.0b8
ubuntu 20.04
chrome
```


### Severity

annoyance


Discussion:

Resolving patch:
diff --git a/demo/blocks_essay/run.py b/demo/blocks_essay/run.py
--- a/demo/blocks_essay/run.py
+++ b/demo/blocks_essay/run.py
@@ -1,20 +1,22 @@
 import gradio as gr
 
+
 def change_textbox(choice):
     if choice == "short":
-        return gr.Radio.update(lines=2, visible=True)
+        return gr.Textbox.update(lines=2, visible=True)
     elif choice == "long":
-        return gr.Radio.update(lines=8, visible=True)
+        return gr.Textbox.update(lines=8, visible=True)
     else:
-        return gr.Radio.update(visible=False)
+        return gr.Textbox.update(visible=False)
 
 
 with gr.Blocks() as demo:
-    radio = gr.Radio(["short", "long", "none"], 
-                     label="What kind of essay would you like to write?")
+    radio = gr.Radio(
+        ["short", "long", "none"], label="What kind of essay would you like to write?"
+    )
     text = gr.Textbox(lines=2, interactive=True)
 
     radio.change(fn=change_textbox, inputs=radio, outputs=text)
 
 if __name__ == "__main__":
-    demo.launch()
\ No newline at end of file
+    demo.launch()
diff --git a/demo/blocks_outputs/run.py b/demo/blocks_outputs/run.py
--- a/demo/blocks_outputs/run.py
+++ b/demo/blocks_outputs/run.py
@@ -35,7 +35,7 @@
             headers=["One", "Two", "Three", "Four"],
             col_count=(4, "fixed"),
             row_count=(7, "fixed"),
-            value=[[1, 2, 3, 4]],
+            value=[[0, 0, 0, 0]],
         )
         gr.Dataframe(
             interactive=True, headers=["One", "Two", "Three", "Four"], col_count=4


Test patch:
Repository: gradio-app/gradio

Issue:
DataFrame label not showing
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

When creating a dataframe with a label, the label does not show:

`     gr.Dataframe(headers=["Mean","Min","Max","Std"], row_count=[1,'fixed'], col_count=[4,'fixed'], datatype="number", type="pandas", label = "testtt",show_label = True)`
<img width="242" alt="image" src="https://user-images.githubusercontent.com/105737531/168857762-0c43629f-8864-40c4-8d4f-1041f7ab4295.png">


### Reproduction

Create a DataFrame input with label

### Screenshot

_No response_

### Logs

_No response_

### System Info

```shell
Gradio 3.0.1
Python 3.9.7
Windows
```


### Severity

critical


Discussion:
Thanks for the catch @atben123!

@pngwn I think we can put a tiny dataframe icon and label above the dataframe similar to how we do it for images, video, and so on.  
@abidlabs I don't think we can because it will cover the table. We don't wrap the table in the same container that most of the other components have. I'll see what I can come up with.

Resolving patch:
diff --git a/demo/blocks_outputs/run.py b/demo/blocks_outputs/run.py
--- a/demo/blocks_outputs/run.py
+++ b/demo/blocks_outputs/run.py
@@ -27,15 +27,18 @@
         md = gr.Markdown(show_label=False)
         label = gr.Label(show_label=False)
         highlight = gr.HighlightedText(show_label=False)
-        gr.Dataframe(interactive=True, col_count=(3, "fixed"))
-        gr.Dataframe(interactive=True, col_count=4)
-        gr.Dataframe(interactive=True, headers=["One", "Two", "Three", "Four"])
+        gr.Dataframe(interactive=True, col_count=(3, "fixed"), label="Dataframe")
+        gr.Dataframe(interactive=True, col_count=4, label="Dataframe")
+        gr.Dataframe(
+            interactive=True, headers=["One", "Two", "Three", "Four"], label="Dataframe"
+        )
         gr.Dataframe(
             interactive=True,
             headers=["One", "Two", "Three", "Four"],
             col_count=(4, "fixed"),
             row_count=(7, "fixed"),
             value=[[0, 0, 0, 0]],
+            label="Dataframe",
         )
         gr.Dataframe(
             interactive=True, headers=["One", "Two", "Three", "Four"], col_count=4


Test patch:
Repository: gradio-app/gradio

Issue:
Blocks API - Checkbox change does not trigger
### Describe the bug

Can't get the `Checkbox.change` event to trigger 😕  did I read the documentation wrong?

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Reproduction

```python
import gradio as gr

def update(checked):
    print("Updating component")
    return str(checked)

def main() -> gr.Blocks:
    demo = gr.Blocks()

    with demo:
        checkbox = gr.Checkbox(False)
        text_output = gr.Markdown("False")
        
        checkbox.change(
            update,
            checkbox,
            text_output,
        )

    return demo

if __name__ == "__main__":
    demo = main()
    demo.launch()
```

[Link to Demo Space](https://huggingface.co/spaces/Fanilo/gradio-sandbox)

### Screenshot

![test](https://user-images.githubusercontent.com/5351877/169658197-a2b95b03-8c2e-4bbc-8776-641988864d3f.gif)


### Logs

```shell
No logs in Python/JS
```


### System Info

```shell
Gradio 3.0.3
Windows
Firefox/Chrome latest stable
```


### Severity

serious, but I can work around it


Discussion:
Thanks @andfanilo, can reproduce this issue as well!

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@
 
 setup(
     name="gradio",
-    version="3.0.11",
+    version="3.0.12",
     include_package_data=True,
     description="Python library for easily interacting with trained machine learning models",
     long_description=long_description,


Test patch:
Repository: gradio-app/gradio

Issue:
visible kwarg not attached to many Components
make visible kwarg work for all components


Discussion:

Resolving patch:
diff --git a/demo/blocks_form/run.py b/demo/blocks_form/run.py
--- a/demo/blocks_form/run.py
+++ b/demo/blocks_form/run.py
@@ -9,7 +9,7 @@
     submit_btn = gr.Button("Submit")
 
     diagnosis_box = gr.Textbox(label="Diagnosis")
-    patient_summary_box = gr.Textbox(label="Patient Summary")
+    patient_summary_box = gr.Textbox(label="Patient Summary", visible=False)
 
     def submit(name, age, symptoms):
         if len(name) == 0:
@@ -18,7 +18,7 @@ def submit(name, age, symptoms):
             return {error_box: gr.update(value="Enter valid age", visible=True)}
         return {
             diagnosis_box: "covid" if "Cough" in symptoms else "flu",
-            patient_summary_box: f"{name}, {age} y/o",
+            patient_summary_box: gr.update(value=f"{name}, {age} y/o", visible=True)
         }
 
     submit_btn.click(


Test patch:
Repository: gradio-app/gradio

Issue:
Couple event triggers together
- [X] I have searched to see if a similar issue already exists.

We might want to enable coupling event trigger together for ease of readibility within the code.
[Example ](https://huggingface.co/spaces/huggingface/library-metrics/blob/main/app.py)from @abidlabs:
```

    lib.change(get_plot, [lib, time], plt)
    time.change(get_plot, [lib, time], plt)    
    demo.load(get_plot, [lib, time], plt)    
```

My Suggestion:

```
create_events( [lib.change, time.change, demo.load], [lib,time], [plt] )
```


Discussion:
Upon further reflection, I think we should avoid creating another method and just let people use plain, readable Python for this:

```py
for event in [lib.change, time.change, demo.load]:
  event(get_plot, [lib, time], plt)
```
Agreed, but let's have an example demo for that.

Resolving patch:
diff --git a/demo/blocks_multiple_event_triggers/run.py b/demo/blocks_multiple_event_triggers/run.py
new file mode 100644
--- /dev/null
+++ b/demo/blocks_multiple_event_triggers/run.py
@@ -0,0 +1,34 @@
+import gradio as gr
+import pypistats
+from datetime import date
+from dateutil.relativedelta import relativedelta
+import pandas as pd
+
+pd.options.plotting.backend = "plotly"
+
+
+def get_plot(lib, time):
+    data = pypistats.overall(lib, total=True, format="pandas")
+    data = data.groupby("category").get_group("with_mirrors").sort_values("date")
+    start_date = date.today() - relativedelta(months=int(time.split(" ")[0]))
+    data = data[(data['date'] > str(start_date))]
+    chart = data.plot(x="date", y="downloads")
+    return chart
+
+
+with gr.Blocks() as demo:
+    gr.Markdown(
+        """
+        ## Pypi Download Stats 📈
+        See live download stats for all of Hugging Face's open-source libraries 🤗
+        """)
+    with gr.Row():
+        lib = gr.Dropdown(["transformers", "datasets", "huggingface-hub", "gradio", "accelerate"], label="Library")
+        time = gr.Dropdown(["3 months", "6 months", "9 months", "12 months"], label="Downloads over the last...")
+
+    plt = gr.Plot()
+    # You can add multiple event triggers in 2 lines like this
+    for event in [lib.change, time.change, demo.load]:
+        event(get_plot, [lib, time], [plt])
+
+demo.launch()


Test patch: