def preprocess(self, payload: str | int | float | None) -> str | int | float | None:
        """
        Parameters:
            payload: Selected choice in the radio group
        Returns:
            Passes the value of the selected radio button as a `str | int | float`, or its index as an `int` into the function, depending on `type`.
        """
        if payload is None:
            return None

        choice_values = [value for _, value in self.choices]
        if payload not in choice_values:
            raise Error(
                f"Value: {payload!r} (type: {type(payload)}) is not in the list of choices: {choice_values}"
            )

        if self.type == "value":
            return payload
        elif self.type == "index":
            return choice_values.index(payload)
        else:
            raise ValueError(
                f"Unknown type: {self.type}. Please choose from: 'value', 'index'."
            )

        Parameters:
            payload: Selected choice in the radio group
        Returns:
            Passes the value of the selected radio button as a `str | int | float`, or its index as an `int` into the function, depending on `type`.
        
gradio/components/radio.py