o
    㥵iT                     @   s  d dl Z d dlmZ d dlmZ d dlZd dlZd dlmZ ej	e
ddd d dlmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ de jd< dd Zedkre Zejr`ejneje_ejj ! rsde_"e#d nej$! rde_"e#d nej%! se#d de_"e#d eej&ej"ejej'dZ(e#d eej)ej*ej"dZ+e#d ee(e+ej'ejdZ,e-e,.edg dd d!d"d#d"d$d%	 e#d& ee,Z/ee/ej0Z1e1j2dd' dS dS )(    N)ArgumentParser)Path)loggerz.project-rootT)	indicator
pythonpath)TTSInferenceEngine)
load_model)launch_thread_safe_queue)ServeTTSRequest)	build_app)get_inference_wrapperfalseEINX_FILTER_TRACEBACKc                  C   s   t  } | jdtdd | jdtdd | jdtdd | jdtd	d | jd
dd | jddd | jdtdd | jdtdd |  S )Nz--llama-checkpoint-pathzcheckpoints/openaudio-s1-mini)typedefaultz--decoder-checkpoint-pathz'checkpoints/openaudio-s1-mini/codec.pthz--decoder-config-namemodded_dac_vqz--devicecudaz--half
store_true)actionz	--compilez--max-gradio-lengthr   z--themelight)r   add_argumentr   strint
parse_args)parser r   C/home/ubuntu/.local/lib/python3.10/site-packages/tools/run_webui.pyr      s$   r   __main__mpsz!mps is available, running on mps.xpuz!XPU is available, running on XPU.z&CUDA is not available, running on CPU.cpuzLoading Llama model...)checkpoint_pathdevice	precisioncompilezLoading VQ-GAN model...)config_namer!   r"   z#Decoder model loaded, warming up...)llama_queuedecoder_modelr$   r#   zHello world.i      gffffff?g      ?wav)	text
referencesreference_idmax_new_tokenschunk_lengthtop_prepetition_penaltytemperatureformatz(Warming up done, launching the web UI...)show_api)3osargparser   pathlibr   pyrootutilstorchlogurur   
setup_root__file__fish_speech.inference_enginer    fish_speech.models.dac.inferencer   load_decoder_model*fish_speech.models.text2semantic.inferencer	   fish_speech.utils.schemar
   tools.webuir   tools.webui.inferencer   environr   __name__argshalfbfloat16r#   backendsr   is_availabler"   infor   r   llama_checkpoint_pathr$   r&   decoder_config_namedecoder_checkpoint_pathr'   inference_enginelist	inferenceinference_fctthemeapplaunchr   r   r   r   <module>   s    







