def from_string(s):
        """Initialize the response parsing type from a string."""
        try:
            if s is None:
                return ResponseParseType("unsupported")
            return ResponseParseType(s.lower())
        except KeyError as exc:
            raise ValueError(f"Invalid metric type: {s}") from exc
Initialize the response parsing type from a string.
vlmeval/dataset/utils/megabench/response_parse_type.py