o
    HŠ!i|  ã                   @   s8   d dl Z d dlmZ ddlmZ ddlmZ dd„ ZdS )é    N)ÚPathé   )Úget_pipeline_path)Úloggingc              
   C   s8  t | ƒ}t|ƒj}|d u rt d¡ tƒ pd}n|}t|ƒ}|jdvr'|| }|j ¡ sRz
|jj	ddd W n t
yQ } zt d|› ¡ W Y d }~d S d }~ww | ¡ rot d|› d¡ tƒ  ¡ }|d	krot d
¡ d S zt ||¡ t d|› ¡ W d S  t
y› } zt d|› ¡ W Y d }~d S d }~ww )NzTPlease enter the path that you want to save the pipeline config file: (default `./`)Ú.)z.yamlz.ymlT)ÚparentsÚexist_okzFailed to create directory: z	The file(z') already exists. Is it covered? (y/N):ÚyzExit!z'The pipeline config has been saved to: zFile saving failed: )r   r   Únamer   ÚinfoÚinputÚsuffixÚparentÚexistsÚmkdirÚ	ExceptionÚerrorÚlowerÚwarningÚshutilÚcopy2)ZpipelineZ	save_pathÚ	file_pathÚ	file_nameÚtarget_pathÚeÚ	overwrite© r   úr/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/paddlex/utils/interactive_get_pipeline.pyÚinteractive_get_pipeline   s@   
ÿ

€þ

€ÿr   )r   Úpathlibr   Z!inference.utils.get_pipeline_pathr   Úutilsr   r   r   r   r   r   Ú<module>   s
   