Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion language/mixtral-8x7b/evaluate_mbxp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,25 @@ def worker(inp_queue, out_queue):
break

key = f"{problem['lang']}_{problem['entry_point']}"
checker = eval(f"check_correctness_{problem['lang']}")

lang_to_checker_map = {
"cpp": check_correctness_cpp,
"csharp": check_correctness_csharp,
"go": check_correctness_go,
"java": check_correctness_java,
"javascript": check_correctness_javascript,
"kotlin": check_correctness_kotlin,
"perl": check_correctness_perl,
"php": check_correctness_php,
"python": check_correctness_python,
"ruby": check_correctness_ruby,
"scala": check_correctness_scala,
"swift": check_correctness_swift,
"typescript": check_correctness_typescript,
}

checker = lang_to_checker_map[problem["lang"]]

problem["task_id"] = key
problem["test"] = problem["test_code"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ def main():
dataloader = DataLoader(dataset, batch_size=1)

if not hasattr(torchvision_quantization_models, args.model):
raise ValueError(f"Model {args.model} not found in torchvision quantization models")


model = getattr(torchvision_quantization_models, args.model)(pretrained=True, progress=True, quantize=False)
raise ValueError(
f"Model {args.model} not found in torchvision quantization models")

model = getattr(
torchvision_quantization_models,
args.model)(
pretrained=True,
progress=True,
quantize=False)
quantize_model(model, dataloader)
print(model)

Expand Down
Loading