o
    6ti                     @   s   d d Z dd Zdd ZdS )c              
   C   s`   dd | d d D }z| | d  }W |S  ty/ } ztd| W Y d }~d S d }~ww )Nc                 S      g | ]}|d  qS )label .0cr   r   Z/home/ubuntu/.local/lib/python3.10/site-packages/lm_eval/tasks/aradice/openbookqa/utils.py
<listcomp>       z!doc_to_target.<locals>.<listcomp>questionchoices	answerKeyFailed)indexlstrip	Exceptionprint)doclabelsier   r   r   doc_to_target   s   
r   c                 C   s   dd | d d D }|S )Nc                 S   r   )textr   r   r   r   r   r      r	   z!doc_to_choice.<locals>.<listcomp>r
   r   r   )r   textsr   r   r   doc_to_choice   s   r   c                 C   s   | d d   S )Nr
   stem)strip)r   r   r   r   doc_to_text   s   r   N)r   r   r   r   r   r   r   <module>   s    