o
    7ti2                     @   s   d dl mZ g dZdddZeeddZeeddZdd	 Zeed
dZeeddZeeddZ	eeddZ
eeddZeeddZeeddZeeddZeeddZeeddZeeddZeeddZeeddZeeddZdS )    )partial)
ABCDEFGHIJTc                 C   s   d}| d }| d }||d 7 }|d7 }t |D ]\}}|ttkr$ n|t|  d|  d7 }q|rE| d dd	}||d
 7 }|S |d	7 }|S )Nz
Question:
questionoptions
z	Options:
z. cot_contentzA: Let's think step by step.z!Answer: Let's think step by step.z

)	enumeratelenchoicesstripreplace)exampleincluding_answerpromptr   r   ioptr    r   P/home/ubuntu/.local/lib/python3.10/site-packages/lm_eval/tasks/mmlu_pro/utils.pyformat_cot_example   s"   r   F)r   c                    s   |   fddS )Nc                    s   | d  kS )Ncategoryr   )xsubjectr   r   <lambda>#   s    zprocess_docs.<locals>.<lambda>)filter)datasetr!   r   r    r   process_docs"   s   r%   biologyr    business	chemistryzcomputer science	economicsengineeringhealthhistorylawmathother
philosophyphysics
psychologyN)T)	functoolsr   r   r   doc_to_textfewshot_to_textr%   process_biologyprocess_businessprocess_chemistryprocess_computer_scienceprocess_economicsprocess_engineeringprocess_healthprocess_historyprocess_lawprocess_mathprocess_otherprocess_philosophyprocess_physicsprocess_psychologyr   r   r   r   <module>   s(    
