o
    7ti                     @   s  d dl mZ d dlmZmZ d dlmZ eeeZee Z	g dZ
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)basenamedirname)	LANG_LIBS)ABCDEFGHIJKLMNOP
   Tc                 C   s   t d  d}| d }||d 7 }|t d  d7 }ttD ]}| d|  }|d ur5|dt| |7 }q|rL| d t d t d	 }||d
 7 }|S |t d	 7 }|S )Nr   
question   option_z{}. {}
cot_content      z

)	lang_dictrangemax_opt_numformatchoicesreplace)exampleincluding_answerpromptr   ioptr    r)   T/home/ubuntu/.local/lib/python3.10/site-packages/lm_eval/tasks/mmlu_prox/uk/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>6   s    zprocess_docs.<locals>.<lambda>)filter)datasetr/   r)   r.   r*   process_docs5   s   r3   biologyr.   business	chemistryzcomputer science	economicsengineeringhealthhistorylawmathother
philosophyphysics
psychologyN)T)	functoolsr   os.pathr   r   !lm_eval.tasks.mmlu_prox.lang_libsr   __file__	lang_abbrr   r"   r    r+   doc_to_textfewshot_to_textr3   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>   s2    
