(
model_id,
question_file,
answer_file,
host,
port
)
| 18 | import multiprocessing as mp |
| 19 | |
| 20 | def run_eval( |
| 21 | model_id, |
| 22 | question_file, |
| 23 | answer_file, |
| 24 | host, |
| 25 | port |
| 26 | ): |
| 27 | questions = load_questions(question_file, None, None) |
| 28 | random.shuffle(questions) |
| 29 | |
| 30 | chunk_size = len(questions) |
| 31 | for i in range(0, len(questions), chunk_size): |
| 32 | get_model_answers( |
| 33 | model_id, |
| 34 | questions[i : i + chunk_size], |
| 35 | answer_file, |
| 36 | host, |
| 37 | port, |
| 38 | ) |
| 39 | |
| 40 | def query_model(x): |
| 41 | question, host, port = x |
no test coverage detected