MCPcopy Create free account
hub / github.com/InternScience/SciReason / test_model

Function test_model

tools/test_api_model.py:156–170  ·  view source on GitHub ↗
(model_cfg: ConfigDict)

Source from the content-addressed store, hash-verified

154
155
156def test_model(model_cfg: ConfigDict):
157 for meta_template in meta_templates:
158 print('Testing meta_template: ', meta_template)
159 model_cfg['meta_template'] = meta_template
160 model = build_model_from_cfg(model_cfg)
161 print('Prompt 0 length:',
162 model.get_token_len_from_template(test_prompts[0]))
163 print('Prompt 1 length:',
164 model.get_token_len_from_template(test_prompts[1]))
165 print('Prompt lengths: ',
166 model.get_token_len_from_template(test_prompts))
167 msgs = model.generate_from_template(test_prompts, max_out_len=100)
168 print('Prompt 0 response:', msgs[0])
169 print('Prompt 1 response:', msgs[1])
170 print('-' * 100)
171
172
173def parse_args():

Callers 1

mainFunction · 0.85

Calls 3

build_model_from_cfgFunction · 0.90

Tested by

no test coverage detected