Download reference/code/dMoE/evaluations/evaluation/math500/prompt.py from Ouzhang/hku_diffusion_dllm: direct link, hf CLI and curl.
- Browser
- Download file 408 Bytes
-
https://huggingface.co/Ouzhang/hku_diffusion_dllm/resolve/main/reference/code/dMoE/evaluations/evaluation/math500/prompt.py
- Command line
-
hf download hf://Ouzhang/hku_diffusion_dllm/reference/code/dMoE/evaluations/evaluation/math500/prompt.py
-
curl -L -o prompt.py https://huggingface.co/Ouzhang/hku_diffusion_dllm/resolve/main/reference/code/dMoE/evaluations/evaluation/math500/prompt.py
408 Bytes
| import os | |
| from collections import defaultdict | |
| from typing import Any | |
| import io | |
| import numpy as np | |
| from tqdm import tqdm | |
| QUERY_TEMPLATE_MATH = """ | |
| Please answer the question step by step and put the answer in \\boxed{{}}. {question} | |
| """.strip() | |
| def format_prompt(row: dict): | |
| prompt_messages = QUERY_TEMPLATE_MATH.format( | |
| question=row['problem'] | |
| ) | |
| return prompt_messages, row['answer'] | |