MCPcopy
hub / github.com/open-compass/VLMEvalKit / check_content

Method check_content

vlmeval/vlm/base.py:49–62  ·  view source on GitHub ↗

Check the content type of the input. Four types are allowed: str, dict, liststr, listdict.

(self, msgs)

Source from the content-addressed store, hash-verified

47 raise NotImplementedError
48
49 def check_content(self, msgs):
50 """Check the content type of the input. Four types are allowed: str, dict, liststr, listdict.
51 """
52 if isinstance(msgs, str):
53 return 'str'
54 if isinstance(msgs, dict):
55 return 'dict'
56 if isinstance(msgs, list):
57 types = [self.check_content(m) for m in msgs]
58 if all(t == 'str' for t in types):
59 return 'liststr'
60 if all(t == 'dict' for t in types):
61 return 'listdict'
62 return 'unknown'
63
64 def preproc_content(self, inputs):
65 """Convert the raw input messages to a list of dicts.

Callers 3

preproc_contentMethod · 0.95
generateMethod · 0.95
chatMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected