MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / run

Method run

accessory/eval_mm/utils/math_utils.py:55–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 pass
54
55 def run(self):
56 if self.use_process:
57 manager = multiprocessing.Manager()
58 return_dict = manager.dict()
59 process = multiprocessing.Process(
60 target=self.execute_code, args=(return_dict,))
61 process.start()
62 process.join(timeout=self.timeout)
63 process.terminate()
64 else:
65 return_dict = {}
66 thread = threading.Thread(
67 target=self.execute_code, args=(return_dict,))
68 thread.start()
69 thread.join(timeout=self.timeout)
70 if thread.is_alive():
71 thread.join() # Ensures the thread is terminated before continuing
72 print('time out!')
73 self.error = 'Execution timed out'
74
75 if 'result' in return_dict:
76 return return_dict['result']
77 else:
78 return ''
79
80
81def read_jsonl(path: str):

Callers 1

execute_with_timeoutFunction · 0.95

Calls 1

printFunction · 0.85

Tested by

no test coverage detected