MCPcopy Create free account
hub / github.com/SalesforceAIResearch/perfcodegen / infer_local_model_for_all

Function infer_local_model_for_all

src/inference.py:1019–1035  ·  view source on GitHub ↗
(model, output_path, device_num)

Source from the content-addressed store, hash-verified

1017
1018
1019def infer_local_model_for_all(model, output_path, device_num):
1020 code_datasets = [
1021 "openai_humaneval",
1022 "codeparrot/apps",
1023 "mbpp",
1024 "deepmind/code_contests",
1025 "BAAI/TACO",
1026 "NTU-NLP-sg/xCodeEval"
1027 ]
1028
1029 prefix = "<s>[INST] " if "Mixtral" in model else None
1030 suffix = " [/INST]" if "Mixtral" in model else None
1031 model = LocalModel(model, device_num, tensor_parallel_size = 8 if "Mixtral" in model else 4)
1032
1033
1034 for d in code_datasets:
1035 batch_infer_local_model(model, d, output_path, device_num, prefix = prefix, suffix = suffix, chat = True if "chat" in model.name else False)
1036
1037
1038def infer_all_local_models_for_all(output_path, device_num, n = 200, temperature = 0.7, dataset_repo = "test_datasets"):

Callers

nothing calls this directly

Calls 2

LocalModelClass · 0.90
batch_infer_local_modelFunction · 0.85

Tested by

no test coverage detected