o
    7ti                  
   @   s   d dl Z d dlZddddddddd	d
dddddddddddddddddddZdededdfddZdddZedkrGe  dS dS )     NrichtigJaNein)QUESTION_WORDYESNOrightYesNoverdadu   Sízn'est-ce pasOuiu	   ですねu   はいu	   いいえu   맞죠u   예u	   아니요u   对吧u   是u   不是)deenesfrjakozh
output_dir	overwritereturnc           	      C   s  g }t  D ]m}d| d}zWt | d }t | d }t | d }t|  d| |r,dndd	d
+}|d tjd|d| dd| d| d| d| d	d|dd W d   n1 s_w   Y  W q tys   || Y qw t|dkrtdd	| dS )z
    Generate a yaml file for each language.

    :param output_dir: The directory to output the files to.
    :param overwrite: Whether to overwrite files if they already exist.
    paws_z.yamlr   r   r   /wxutf8)encodingz# Generated by utils.py
pawsx_template_yaml z{{[sentence1+", z? z, "+sentence2, sentence1+", z, "+sentence2]}})includedataset_nametaskdoc_to_textdoc_to_choiceT)allow_unicodeNr   zJFiles were not created because they already exist (use --overwrite flag): z, )
	LANGUAGESkeysopenwriteyamldumpFileExistsErrorappendlenjoin)	r   r   errlang	file_namer   r   r   f r3   Y/home/ubuntu/.local/lib/python3.10/site-packages/lm_eval/tasks/paws-x/_generate_config.pygen_lang_yamls1   sT   

r5   c                  C   sF   t  } | jddddd | jdddd	 |  }t|j|jd
 dS )z9Parse CLI args and generate language-specific yaml files.z--overwriteF
store_truez%Overwrite files if they already exist)defaultactionhelpz--output-dir.z Directory to write yaml files to)r7   r9   )r   r   N)argparseArgumentParseradd_argument
parse_argsr5   r   r   )parserargsr3   r3   r4   main[   s   rA   __main__)r   N)r;   r)   r%   strboolr5   rA   __name__r3   r3   r3   r4   <module>   sH    	'
*
