Repository: gradio-app/gradio

Issue:
A few small component label issues
### Describe the bug

As I was creating demos for the course, I noticed some small issues related to the labels of the components:
* The label of an input component is sometimes `null` (by default, it should be "Input")
* The default input component label ("Input") and output component label ("Output") should both be lower-cased to be consistent e.g. with parameters, which are typically lower case

### Reproduction

For one such example, run:

```python
gr.Interface.load("spaces/abidlabs/remove-bg", inputs="webcam", title="Remove your webcam background!").launch()
```

### Screenshot

![image](https://user-images.githubusercontent.com/1778297/158701233-6a0b646b-d99c-4197-b77e-f26e45d5066a.png)


### Logs

_No response_

### System Info

```shell
2.8.10
```


### Severity

annoyance


Discussion:

Resolving patch:
diff --git a/gradio/flagging.py b/gradio/flagging.py
--- a/gradio/flagging.py
+++ b/gradio/flagging.py
@@ -330,7 +330,7 @@ def flag(
                 for i, component in enumerate(interface.input_components):
                     component_label = interface.config["input_components"][i][
                         "label"
-                    ] or "Input_{}".format(i)
+                    ] or "input_{}".format(i)
                     headers.append(component_label)
                     infos["flagged"]["features"][component_label] = {
                         "dtype": "string",
@@ -348,7 +348,7 @@ def flag(
                 for i, component in enumerate(interface.output_components):
                     component_label = interface.config["output_components"][i][
                         "label"
-                    ] or "Output_{}".format(i)
+                    ] or "output_{}".format(i)
                     headers.append(component_label)
                     infos["flagged"]["features"][component_label] = {
                         "dtype": "string",
@@ -377,7 +377,7 @@ def flag(
             for i, component in enumerate(interface.input_components):
                 label = interface.config["input_components"][i][
                     "label"
-                ] or "Input_{}".format(i)
+                ] or "input_{}".format(i)
                 filepath = component.save_flagged(
                     self.dataset_dir, label, input_data[i], None
                 )
@@ -389,7 +389,7 @@ def flag(
             for i, component in enumerate(interface.output_components):
                 label = interface.config["output_components"][i][
                     "label"
-                ] or "Output_{}".format(i)
+                ] or "output_{}".format(i)
                 filepath = (
                     component.save_flagged(
                         self.dataset_dir, label, output_data[i], None
diff --git a/gradio/utils.py b/gradio/utils.py
--- a/gradio/utils.py
+++ b/gradio/utils.py
@@ -215,29 +215,34 @@ def get_config_file(interface: Interface) -> Dict[str, Any]:
     }
     try:
         param_names = inspect.getfullargspec(interface.predict[0])[0]
-        for iface, param in zip(config["input_components"], param_names):
-            if not iface["label"]:
-                iface["label"] = param.replace("_", " ")
-        for i, iface in enumerate(config["output_components"]):
+        for index, component in enumerate(config["input_components"]):
+            if not component["label"]:
+                if index < len(param_names):
+                    component["label"] = param_names[index].replace("_", " ")
+                else:
+                    component["label"] = (
+                        f"input {index + 1}"
+                        if len(config["input_components"]) > 1
+                        else "input"
+                    )
+        for index, component in enumerate(config["output_components"]):
             outputs_per_function = int(
                 len(interface.output_components) / len(interface.predict)
             )
-            function_index = i // outputs_per_function
-            component_index = i - function_index * outputs_per_function
-            ret_name = (
-                "Output " + str(component_index + 1)
-                if outputs_per_function > 1
-                else "Output"
-            )
-            if iface["label"] is None:
-                iface["label"] = ret_name
+            function_index = index // outputs_per_function
+            component_index = index - function_index * outputs_per_function
+            if component["label"] is None:
+                component["label"] = (
+                    f"output {component_index + 1}"
+                    if outputs_per_function > 1
+                    else "output"
+                )
             if len(interface.predict) > 1:
-                iface["label"] = (
+                component["label"] = (
                     interface.function_names[function_index].replace("_", " ")
                     + ": "
-                    + iface["label"]
+                    + component["label"]
                 )
-
     except ValueError:
         pass
     if interface.examples is not None:


Test patch: