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

Method working

vlmeval/api/base.py:59–81  ·  view source on GitHub ↗

If the API model is working, return True, else return False. Returns: bool: If the API model is working, return True, else return False.

(self)

Source from the content-addressed store, hash-verified

57 return ret_code, answer, log
58
59 def working(self):
60 """If the API model is working, return True, else return False.
61
62 Returns:
63 bool: If the API model is working, return True, else return False.
64 """
65 self.old_timeout = None
66 if hasattr(self, 'timeout'):
67 self.old_timeout = self.timeout
68 self.timeout = 120
69
70 retry = 5
71 while retry > 0:
72 ret = self.generate('hello')
73 if ret is not None and ret != '' and self.fail_msg not in ret:
74 if self.old_timeout is not None:
75 self.timeout = self.old_timeout
76 return True
77 retry -= 1
78
79 if self.old_timeout is not None:
80 self.timeout = self.old_timeout
81 return False
82
83 def check_content(self, msgs):
84 """Check the content type of the input. Four types are allowed: str, dict, liststr, listdict.

Callers 15

MMTBench_result_transferFunction · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80
evaluateMethod · 0.80

Calls 1

generateMethod · 0.95

Tested by

no test coverage detected