CoolFace
Apppublic

sourav-das/stem-separator

sourceHugging Facemitupdated 6mo agoView on Hugging Face
3likes
task_queue.cpython-313.pyc37 linesDownload Raw Back to __pycache__
1�

2��i�����%SSKrSSKJr SSKJr SSKJr \"SS55r0r\	\3\4\S'Sq\RS-\S'S	\R4S4jrS\5S	\S-4SjrS\6S
\\7S\8S	\4SjrSrg)�N)�	dataclass)�StemSeparatorService)�file_managerc�r�\rSrSr%Sr\\S'Sr\\S'Sr	\\S'Sr9\\\4S-\S	'Sr\S-\S10'Sr
g)�JobProgress��queued�stateg�progresszWaiting in queue...�messageN�stems�error�)�__name__�11__module__�__qualname__�__firstlineno__r12�str�__annotations__r�floatrr
�dictr�__static_attributes__r��backend\task_queue.pyrrsE���E�3���H�e��(�G�S�(�#'�E�4��S��>�D� �'��E�3��:�rr�jobs�_queue�returnc�D�[c[R"SS9q[$)N�)�maxsize)r�asyncio�Queuerrr�	get_queuer#s��
�~����q�)���Mr�job_idc�,�[RU5$)N)r�get)r$s r�get_job_progressr's���8�8�F��rr
�
output_formatc��# �[5nUR5(ag[5[U'UR	XU45IShv�N gN7f)z9Enqueue a separation job. Returns False if queue is full.FNT)r#�fullrr�put)r$r
r(�qs    r�enqueue_jobr-!sD�����A��v�v�x�x���=�D��L�13�%�%��
�.�14/�/�/��0�s�AA�15A�Ac	��^# �[5n[5nUR5IShv�Nup#n[RU5mTc[	5mT[U'S[16S[4U4Sjjn[R"U5nUc(STl	STl17STlUR5 M�[[R"U55n[R"5nUR!SUR"[U5UUUU5IShv�Nn	STl	S	TlS18TlU	TlUR5 GM1GNN6![(aRn19[RU[	55mSTl	[U205Tl21SU223TlT[U'Sn23A24NoSn25A26ff=f!UR5 f=f7f)z:Single worker that processes separation jobs sequentially.Nr27�pctc�b>�UTlUTlSSSSS.nURXS35Tlg)NzLoading BS-RoFormer model...zSeparating stems...zFinalizing output files...�Separation complete!)�
loading_model�28separating�29finalizing�donez...)r30rr&r)r31r/�messagesrs   �r�update_progress�$worker_loop.<locals>.update_progress8s>���!&���$'��!�%C�"7�">�2�	��$,�<�<����}�#E�� rrzInput file not foundzError: input file not foundr5g�?r1zError: )rr#r&rrrrr�get_input_filer32rr�	task_done�get_output_dirr!�get_event_loop�run_in_executor�separaterr
�	Exception)�	separatorr,r$r
r(r7�33input_file�34output_dir�loop�result�ers           @r�worker_looprF+s�����$�&�I���A�35�-.�U�U�W�}�$��}�2	��x�x��'�H���&�=��'��V��	
F�s�	
F��	
F�&�4�4�V�<�J��!�!(���!7���#@�� ��8
�K�K�M�5�\�8�8��@�A�J��)�)�+�D��/�/���"�"��J��������F�$�H�N� #�H��5�H��#�H�N�
�K�K�M�i�'4�:���	$��x�x���
�6�H�$�H�N� ��V�H�N�!(���}�H��#�D��L��	$��
�K�K�M�se�)G�E36�G�A-E�#G�5A!E�E
� E�7G�
E�37F+�AF&�!F.�&F+�+F.�.G�G)r!�dataclassesr�backend.separatorr�backendrrrrrrrr"r#r'�list�boolr-rFrrr�<module>rLs����!�2� ������ "��d�3����!�#���
�
���#��7�=�=���S��[�4�%7���c��$�s�)��C��D��9r