o
    iQ                     @   s.   d dl mZ d dlmZ dd Zd	ddZdS )
    )version)__version__c                 C   sJ   dd l }d|  d}||}|jdkr!| }t|d d S td)Nr   zhttps://pypi.org/pypi/z/json   infor   z1Failed to retrieve version information from PyPI.)requestsgetstatus_codejsonr   parse	Exception)package_namer   urlresponsedata r   P/home/ubuntu/.local/lib/python3.10/site-packages/funasr/utils/version_checker.pyget_pypi_version   s   

r   Fc                 C   sh   t t}td| d | rd S td td}||k r+td| d td d S td|  d S )Nzfunasr version: .zqCheck update of funasr, and it would cost few times. You may disable it by set `disable_update=True` in AutoModelfunasrzNew version is available: z:Please use the command "pip install -U funasr" to upgrade.z+You are using the latest version of funasr-)r   r
   r   printr   )disablecurrent_versionpypi_versionr   r   r   check_for_update   s   
r   N)F)	packagingr   r   r   r   r   r   r   r   r   <module>   s    