def _map_columns()

in ultravox/tools/mds_tool.py [0:0]


    def _map_columns(self, features: dict) -> dict:
        def map_dtype(dtype: str) -> str:
            if dtype == "bool":
                return "int"
            elif dtype == "string":
                return "str"
            return dtype

        # Rewrite type names to match MDS.
        columns = {k: map_dtype(v.dtype) for k, v in features.items()}
        # Remap any audio structure to an array and a sample rate.
        if "audio" in columns:
            del columns["audio"]
            columns["audio_array"] = "ndarray:float32"
            columns["audio_sampling_rate"] = "int"
        return columns