o �J�hM �@shdZddlZddlZddlZddlZdifdejejede fdd�Z Gdd�d�Z Gd d �d �Z dS) z* Non signal processing related utilities. �N�attrs� overridesc Cs�t�|j�j}g}|durt|���}|D]=}d}||vr"||}n t||�r-t||�}nq||vrD||}|jtj usA||jkrCd}nd}|rR|� |�d|���q|jj �dd� |��d�S)z� Return a simple representation string for `obj`. If `attrs` is not None, it should be a list of attributes to include. NFT�=�(�,�)) �inspect� signature� __class__� parameters�list�keys�hasattr�getattr�default�_empty�append�__name__�join) �objrr�paramsZ attrs_repr�attr�display�value�param�r�JC:\pinokio\api\whisper-webui.git\app\env\lib\site-packages\julius\utils.py� simple_repr s*    ��rc@s6eZdZdZejfdd�Zdd�Zdd�Zdd �Z d S) � MarkdownTablea9 Simple MarkdownTable generator. The column titles should be large enough for the lines content. This will right align everything. >>> import io # we use io purely for test purposes, default is sys.stdout. >>> file = io.StringIO() >>> table = MarkdownTable(["Item Name", "Price"], file=file) >>> table.header(); table.line(["Honey", "5"]); table.line(["Car", "5,000"]) >>> print(file.getvalue().strip()) # Strip for test purposes | Item Name | Price | |-----------|-------| | Honey | 5 | | Car | 5,000 | cCs||_||_dS�N)�columns�file)�selfr r!rrr�__init__:s zMarkdownTable.__init__cCs|j�dd�|�d�dS)N�|z| )r!�writer)r"�linerrr�_writeln>szMarkdownTable._writelncCs0|�dd�|jD��|�dd�|jD��dS)Ncss�|] }d|�d�VqdS)� Nr��.0�colrrr� <genexpr>Bs�z'MarkdownTable.header.<locals>.<genexpr>css �|] }dt|�dVqdS)�-�N)�lenr)rrrr,Cs�)r'r �r"rrr�headerAszMarkdownTable.headercCsPg}t||j�D]\}}t|dtt|���}|�d|d�q|�|�dS)N�>r()�zipr �format�strr/rr')r"r&�out�valr+rrrr&Es zMarkdownTable.lineN) r� __module__� __qualname__�__doc__�sys�stdoutr#r'r1r&rrrrr+s  rc@s(eZdZdZdd�Zdd�Zdd�ZdS) �Chronoa� Measures ellapsed time, calling `torch.cuda.synchronize` if necessary. `Chrono` instances can be used as context managers (e.g. with `with`). Upon exit of the block, you can access the duration of the block in seconds with the `duration` attribute. >>> with Chrono() as chrono: ... _ = sum(range(10_000)) ... >>> print(chrono.duration < 10) # Should be true unless on a really slow computer. True cCs d|_dSr)�durationr0rrrr#Zs zChrono.__init__cCst��|_|Sr)�time�_beginr0rrr� __enter__]s zChrono.__enter__cCs0ddl}|j��r|j��t��|j|_dS)Nr)�torch�cuda� is_available� synchronizer?r@r>)r"�exc_type� exc_valueZ exc_tracebckrBrrr�__exit__as  zChrono.__exit__N)rr8r9r:r#rArHrrrrr=Ms   r=) r:r�typing�tpr;r?�Optional�Sequencer5�dictrrr=rrrr�<module>s� �"
Memory