SYMBOL INDEX (8657 symbols across 776 files) FILE: benchmark/benchmark_embedding.py class EmbeddingBenchmarkRunner (line 31) | class EmbeddingBenchmarkRunner(ConcurrentBenchmarkRunner): method __init__ (line 32) | def __init__( method _run (line 52) | async def _run(self): method worker (line 59) | async def worker(self, i: int): method send_request (line 73) | async def send_request(self, request, warming_up: bool = False): function main (line 101) | def main(args: argparse.Namespace): FILE: benchmark/benchmark_latency.py class LatencyBenchmarkRunner (line 29) | class LatencyBenchmarkRunner(BenchmarkRunner): method _run (line 30) | async def _run(self): function main (line 42) | def main(args: argparse.Namespace): FILE: benchmark/benchmark_long.py class LongBenchmarkRunner (line 30) | class LongBenchmarkRunner(ConcurrentBenchmarkRunner): method _run (line 31) | async def _run(self): method worker (line 38) | async def worker(self, i: int): function main (line 53) | def main(args: argparse.Namespace): FILE: benchmark/benchmark_rerank.py class RerankBenchmarkRunner (line 31) | class RerankBenchmarkRunner(ConcurrentBenchmarkRunner): method __init__ (line 32) | def __init__( method _run (line 54) | async def _run(self): method worker (line 61) | async def worker(self, i: int): method send_request (line 75) | async def send_request(self, request, warming_up: bool = False): function main (line 105) | def main(args: argparse.Namespace): FILE: benchmark/benchmark_runner.py function remove_prefix (line 33) | def remove_prefix(text: str, prefix: str) -> str: class RequestOutput (line 40) | class RequestOutput: class BenchmarkRunner (line 50) | class BenchmarkRunner: method __init__ (line 51) | def __init__( method run (line 69) | async def run(self): method warm_up (line 76) | async def warm_up(self, num_requests: int = 5): method _run (line 83) | async def _run(self): method send_request (line 86) | async def send_request(self, request: tuple, warming_up: bool = False): method print_stats (line 180) | def print_stats(self): class ConcurrentBenchmarkRunner (line 378) | class ConcurrentBenchmarkRunner(BenchmarkRunner): method __init__ (line 379) | def __init__( method worker (line 400) | async def worker(self): FILE: benchmark/benchmark_serving.py class ServingBenchmarkRunner (line 31) | class ServingBenchmarkRunner(ConcurrentBenchmarkRunner): method __init__ (line 32) | def __init__( method _run (line 55) | async def _run(self): method warm_up (line 63) | async def warm_up(self, num_requests: int = 5): method worker (line 72) | async def worker(self): function main (line 92) | def main(args: argparse.Namespace): FILE: benchmark/utils.py function get_tokenizer (line 33) | def get_tokenizer( function sample_requests (line 94) | def sample_requests( function generate_sorting_prompts (line 143) | def generate_sorting_prompts( FILE: doc/source/gen_docs.py function mock_engine_libraries (line 23) | def mock_engine_libraries(): function mock_platform_checks (line 99) | def mock_platform_checks(): function build_architecture_to_models (line 215) | def build_architecture_to_models(models): function get_metrics_from_url (line 223) | def get_metrics_from_url(metrics_url): function _can_use_transformers_legacy (line 238) | def _can_use_transformers_legacy(model, model_spec): function _extract_primary_model_src (line 244) | def _extract_primary_model_src(model): function main (line 251) | def main(): FILE: doc/source/norm_zh.py function _zh_len (line 24) | def _zh_len(s): function _zh_split (line 34) | def _zh_split(s): function _normalize (line 53) | def _normalize(string, prefix="", width=76): function main (line 112) | def main(): FILE: examples/AI_podcast.py function get_audio_devices (line 103) | def get_audio_devices() -> str: function callback (line 122) | def callback(indata, frames, time, status): function record_unlimited (line 129) | def record_unlimited() -> numpy.ndarray: function format_prompt (line 162) | def format_prompt(model, audio_input) -> str: function text_to_audio (line 168) | def text_to_audio(response, voice_id): function chat_with_bot (line 185) | def chat_with_bot( function check_word_order (line 337) | def check_word_order(string, first_word, second_word) -> int: FILE: examples/AI_podcast_ZH.py function get_audio_devices (line 110) | def get_audio_devices() -> str: function callback (line 131) | def callback(indata, frames, time, status): function record_unlimited (line 139) | def record_unlimited() -> numpy.ndarray: function lanuch_model (line 176) | def lanuch_model(alice_or_bob, model_a, username, model_uid, system_prom... function format_prompt (line 213) | def format_prompt(model, audio_input) -> str: function text_to_audio (line 219) | def text_to_audio(response, voice_id): function construct_Baichuan_prompt (line 239) | def construct_Baichuan_prompt( function _base_sanitize_generate_config (line 262) | def _base_sanitize_generate_config() -> PytorchGenerateConfig: function baichuan_sanitize_generate_config (line 273) | def baichuan_sanitize_generate_config() -> PytorchGenerateConfig: function _convert_completion_to_chat (line 285) | def _convert_completion_to_chat(completion: Completion) -> ChatCompletion: function chat_with_bot (line 305) | def chat_with_bot( function check_word_order (line 490) | def check_word_order(string, first_word, second_word) -> int: FILE: examples/AI_translate.py function _prompt (line 24) | def _prompt(text): FILE: examples/LangChain_Streamlit_Doc_Chat.py function write_text_file (line 14) | def write_text_file(content, file_path): FILE: examples/gradio_chatinterface.py function flatten (line 80) | def flatten(matrix: List[List[str]]) -> List[str]: function to_chat (line 86) | def to_chat(lst: List[str]) -> List[Dict[str, str]]: function generate_wrapper (line 98) | def generate_wrapper(message: str, history: List[List[str]]) -> str: FILE: setup.py class ExtraCommandMixin (line 53) | class ExtraCommandMixin: method run (line 56) | def run(self): method register_pre_command (line 61) | def register_pre_command(cls, cmd): class CustomInstall (line 65) | class CustomInstall(ExtraCommandMixin, install): class CustomDevelop (line 69) | class CustomDevelop(ExtraCommandMixin, develop): class CustomSDist (line 73) | class CustomSDist(ExtraCommandMixin, sdist): class BuildWeb (line 76) | class BuildWeb(Command): method initialize_options (line 87) | def initialize_options(self): method finalize_options (line 90) | def finalize_options(self): method run (line 94) | def run(cls): function build_long_description (line 128) | def build_long_description(): FILE: versioneer.py class VersioneerConfig (line 331) | class VersioneerConfig: function get_root (line 335) | def get_root(): function get_config_from_root (line 378) | def get_config_from_root(root): class NotThisMethod (line 416) | class NotThisMethod(Exception): function register_vcs_handler (line 425) | def register_vcs_handler(vcs, method): # decorator function run_command (line 436) | def run_command(commands, args, cwd=None, verbose=False, hide_stderr=Fal... function git_get_keywords (line 1146) | def git_get_keywords(versionfile_abs): function git_versions_from_keywords (line 1174) | def git_versions_from_keywords(keywords, tag_prefix, verbose): function git_pieces_from_vcs (line 1245) | def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): function do_vcs_install (line 1385) | def do_vcs_install(versionfile_source, ipy): function versions_from_parentdir (line 1423) | def versions_from_parentdir(parentdir_prefix, root, verbose): function versions_from_file (line 1471) | def versions_from_file(filename): function write_to_version_file (line 1490) | def write_to_version_file(filename, versions): function plus_or_dot (line 1500) | def plus_or_dot(pieces): function render_pep440 (line 1507) | def render_pep440(pieces): function render_pep440_branch (line 1531) | def render_pep440_branch(pieces): function pep440_split_post (line 1560) | def pep440_split_post(ver): function render_pep440_pre (line 1570) | def render_pep440_pre(pieces): function render_pep440_post (line 1594) | def render_pep440_post(pieces): function render_pep440_post_branch (line 1621) | def render_pep440_post_branch(pieces): function render_pep440_old (line 1650) | def render_pep440_old(pieces): function render_git_describe (line 1672) | def render_git_describe(pieces): function render_git_describe_long (line 1692) | def render_git_describe_long(pieces): function render (line 1712) | def render(pieces, style): class VersioneerBadRootError (line 1754) | class VersioneerBadRootError(Exception): function get_versions (line 1758) | def get_versions(verbose=False): function get_version (line 1839) | def get_version(): function get_cmdclass (line 1844) | def get_cmdclass(cmdclass=None): function do_setup (line 2160) | def do_setup(): function scan_setup_py (line 2217) | def scan_setup_py(): function setup_command (line 2254) | def setup_command(): FILE: xinference/__init__.py function _install (line 34) | def _install(): FILE: xinference/_compat.py class JSONSchema (line 78) | class JSONSchema(BaseModel): class ResponseFormatJSONSchema (line 85) | class ResponseFormatJSONSchema(BaseModel): class CreateChatCompletionOpenAI (line 95) | class CreateChatCompletionOpenAI(BaseModel): FILE: xinference/_version.py function get_keywords (line 22) | def get_keywords(): class VersioneerConfig (line 35) | class VersioneerConfig: function get_config (line 39) | def get_config(): class NotThisMethod (line 53) | class NotThisMethod(Exception): function register_vcs_handler (line 61) | def register_vcs_handler(vcs, method): # decorator function run_command (line 74) | def run_command(commands, args, cwd=None, verbose=False, hide_stderr=Fal... function versions_from_parentdir (line 120) | def versions_from_parentdir(parentdir_prefix, root, verbose): function git_get_keywords (line 151) | def git_get_keywords(versionfile_abs): function git_versions_from_keywords (line 179) | def git_versions_from_keywords(keywords, tag_prefix, verbose): function git_pieces_from_vcs (line 250) | def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): function plus_or_dot (line 390) | def plus_or_dot(pieces): function render_pep440 (line 397) | def render_pep440(pieces): function render_pep440_branch (line 421) | def render_pep440_branch(pieces): function pep440_split_post (line 450) | def pep440_split_post(ver): function render_pep440_pre (line 460) | def render_pep440_pre(pieces): function render_pep440_post (line 484) | def render_pep440_post(pieces): function render_pep440_post_branch (line 511) | def render_pep440_post_branch(pieces): function render_pep440_old (line 540) | def render_pep440_old(pieces): function render_git_describe (line 562) | def render_git_describe(pieces): function render_git_describe_long (line 582) | def render_git_describe_long(pieces): function render (line 602) | def render(pieces, style): function get_versions (line 644) | def get_versions(): FILE: xinference/api/dependencies.py function get_api (line 32) | def get_api(request: Request) -> "RESTfulAPI": FILE: xinference/api/oauth2/auth_service.py class TokenData (line 30) | class TokenData(BaseModel): class AuthService (line 35) | class AuthService: method __init__ (line 36) | def __init__(self, auth_config_file: Optional[str]): method config (line 41) | def config(self): method is_legal_api_key (line 45) | def is_legal_api_key(key: str) -> bool: method init_auth_config (line 49) | def init_auth_config(self): method __call__ (line 70) | def __call__( method get_user (line 119) | def get_user(self, username: str) -> Optional[User]: method get_user_and_scopes_with_api_key (line 125) | def get_user_and_scopes_with_api_key( method authenticate_user (line 134) | def authenticate_user(self, username: str, password: str): method generate_token_for_user (line 142) | def generate_token_for_user(self, username: str, password: str): FILE: xinference/api/oauth2/types.py class LoginUserForm (line 19) | class LoginUserForm(BaseModel): class User (line 24) | class User(LoginUserForm): class AuthConfig (line 29) | class AuthConfig(BaseModel): class AuthStartupConfig (line 35) | class AuthStartupConfig(BaseModel): FILE: xinference/api/oauth2/utils.py function create_access_token (line 21) | def create_access_token( function verify_password (line 37) | def verify_password(plain_password, hashed_password): function get_password_hash (line 52) | def get_password_hash(password): FILE: xinference/api/responses.py class JSONResponse (line 24) | class JSONResponse(StarletteJSONResponse): method render (line 27) | def render(self, content: Any) -> bytes: FILE: xinference/api/restful_api.py class RESTfulAPI (line 91) | class RESTfulAPI(CancelMixin): method __init__ (line 95) | def __init__( method _init_allowed_ip_list (line 114) | def _init_allowed_ip_list(self): method _is_ip_allowed (line 138) | def _is_ip_allowed(self, ip: str) -> bool: method is_authenticated (line 151) | def is_authenticated(self): method handle_request_limit_error (line 155) | def handle_request_limit_error(e: Exception): method _set_trace_model (line 160) | def _set_trace_model(model_uid: Optional[str]) -> None: method _set_trace_model_type (line 176) | def _set_trace_model_type(model_type: Optional[str]) -> None: method _get_supervisor_ref (line 191) | async def _get_supervisor_ref(self) -> xo.ActorRefType[SupervisorActor]: method _get_event_collector_ref (line 198) | async def _get_event_collector_ref(self) -> xo.ActorRefType[EventColle... method _report_error_event (line 205) | async def _report_error_event(self, model_uid: Optional[str], content:... method serve (line 223) | def serve(self, logging_conf: Optional[dict] = None): method _get_builtin_prompts (line 357) | async def _get_builtin_prompts(self) -> JSONResponse: method _get_builtin_families (line 368) | async def _get_builtin_families(self) -> JSONResponse: method build_llm_registration_from_config (line 379) | async def build_llm_registration_from_config( method list_models (line 400) | async def list_models(self) -> JSONResponse: method anthropic_list_models (line 422) | async def anthropic_list_models(self) -> JSONResponse: method anthropic_get_model (line 449) | async def anthropic_get_model(self, model_id: str) -> JSONResponse: method describe_model (line 474) | async def describe_model(self, model_uid: str) -> JSONResponse: method launch_model (line 486) | async def launch_model( method get_instance_info (line 598) | async def get_instance_info( method get_model_replicas (line 612) | async def get_model_replicas(self, model_uid: str) -> JSONResponse: method get_launch_model_progress (line 626) | async def get_launch_model_progress(self, model_uid: str) -> JSONRespo... method cancel_launch_model (line 636) | async def cancel_launch_model(self, model_uid: str) -> JSONResponse: method launch_model_by_version (line 646) | async def launch_model_by_version( method get_model_versions (line 674) | async def get_model_versions( method build_gradio_interface (line 686) | async def build_gradio_interface( method build_gradio_media_interface (line 729) | async def build_gradio_media_interface( method terminate_model (line 769) | async def terminate_model(self, model_uid: str) -> JSONResponse: method _get_model_last_error (line 790) | async def _get_model_last_error(self, replica_model_uid: bytes, e: Exc... method create_completion (line 803) | async def create_completion(self, request: Request) -> Response: method create_message (line 878) | async def create_message(self, request: Request) -> Response: method create_embedding (line 1019) | async def create_embedding(self, request: Request) -> Response: method convert_ids_to_tokens (line 1048) | async def convert_ids_to_tokens(self, request: Request) -> Response: method rerank (line 1075) | async def rerank(self, request: Request) -> Response: method create_transcriptions (line 1108) | async def create_transcriptions( method create_translations (line 1152) | async def create_translations( method create_speech (line 1196) | async def create_speech( method create_images (line 1258) | async def create_images(self, request: Request) -> Response: method sdapi_options (line 1292) | async def sdapi_options(self, request: Request) -> Response: method sdapi_sd_models (line 1312) | async def sdapi_sd_models(self, request: Request) -> Response: method sdapi_samplers (line 1325) | async def sdapi_samplers(self, request: Request) -> Response: method sdapi_txt2img (line 1338) | async def sdapi_txt2img(self, request: Request) -> Response: method sdapi_img2img (line 1362) | async def sdapi_img2img(self, request: Request) -> Response: method create_variations (line 1386) | async def create_variations( method create_inpainting (line 1443) | async def create_inpainting( method create_ocr (line 1498) | async def create_ocr( method create_image_edits (line 1537) | async def create_image_edits( method _stream_image_edit (line 1701) | async def _stream_image_edit( method create_flexible_infer (line 1778) | async def create_flexible_infer(self, request: Request) -> Response: method create_videos (line 1803) | async def create_videos(self, request: Request) -> Response: method create_videos_from_images (line 1835) | async def create_videos_from_images( method create_videos_from_first_last_frame (line 1879) | async def create_videos_from_first_last_frame( method create_chat_completion (line 1925) | async def create_chat_completion(self, request: Request) -> Response: method query_engines_by_model_name (line 2077) | async def query_engines_by_model_name( method register_model (line 2100) | async def register_model(self, model_type: str, request: Request) -> J... method unregister_model (line 2118) | async def unregister_model(self, model_type: str, model_name: str) -> ... method update_model_type (line 2131) | async def update_model_type(self, request: Request) -> JSONResponse: method list_model_registrations (line 2167) | async def list_model_registrations( method get_model_registrations (line 2189) | async def get_model_registrations( method get_model_events (line 2204) | async def get_model_events(self, model_uid: str) -> JSONResponse: method abort_request (line 2216) | async def abort_request( method list_vllm_supported_model_families (line 2240) | async def list_vllm_supported_model_families(self) -> JSONResponse: method extract_guided_params (line 2257) | def extract_guided_params(raw_body: dict) -> dict: method _convert_openai_to_anthropic (line 2303) | def _convert_openai_to_anthropic(self, openai_response: dict, model: s... function run (line 2394) | def run( function run_in_subprocess (line 2429) | def run_in_subprocess( FILE: xinference/api/routers/__init__.py function register_all_routes (line 17) | def register_all_routes(api: RESTfulAPI) -> None: FILE: xinference/api/routers/admin.py function get_status (line 26) | async def get_status(api: "RESTfulAPI" = Depends(get_api)) -> JSONResponse: function get_address (line 36) | async def get_address(api: "RESTfulAPI" = Depends(get_api)) -> JSONRespo... function login_for_access_token (line 40) | async def login_for_access_token( function is_cluster_authenticated (line 50) | async def is_cluster_authenticated( function get_cluster_device_info (line 56) | async def get_cluster_device_info( function get_cluster_version (line 69) | async def get_cluster_version() -> JSONResponse: function get_devices_count (line 78) | async def get_devices_count( function get_workers_info (line 90) | async def get_workers_info( function get_supervisor_info (line 105) | async def get_supervisor_info( function abort_cluster (line 120) | async def abort_cluster( function list_cached_models (line 136) | async def list_cached_models( function list_model_files (line 154) | async def list_model_files( function confirm_and_remove_model (line 176) | async def confirm_and_remove_model( function list_virtual_envs (line 195) | async def list_virtual_envs( function remove_virtual_env (line 216) | async def remove_virtual_env( function get_progress (line 242) | async def get_progress( function register_routes (line 260) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/audio.py function register_routes (line 13) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/embeddings.py function register_routes (line 13) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/images.py function register_routes (line 15) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/llm.py function register_routes (line 15) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/models.py function register_routes (line 13) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/rerank.py function register_routes (line 13) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/routers/videos.py function register_routes (line 15) | def register_routes(api: "RESTfulAPI") -> None: FILE: xinference/api/schemas/requests.py class CreateCompletionRequest (line 15) | class CreateCompletionRequest(CreateCompletion): class Config (line 16) | class Config: class CreateEmbeddingRequest (line 25) | class CreateEmbeddingRequest(BaseModel): class Config (line 32) | class Config: class RerankRequest (line 40) | class RerankRequest(BaseModel): class TextToImageRequest (line 51) | class TextToImageRequest(BaseModel): class SDAPIOptionsRequest (line 61) | class SDAPIOptionsRequest(BaseModel): class SDAPITxt2imgRequst (line 65) | class SDAPITxt2imgRequst(BaseModel): class SDAPIImg2imgRequst (line 81) | class SDAPIImg2imgRequst(BaseModel): class TextToVideoRequest (line 98) | class TextToVideoRequest(BaseModel): class SpeechRequest (line 106) | class SpeechRequest(BaseModel): class RegisterModelRequest (line 116) | class RegisterModelRequest(BaseModel): class AutoConfigLLMRequest (line 122) | class AutoConfigLLMRequest(BaseModel): class UpdateModelRequest (line 127) | class UpdateModelRequest(BaseModel): class BuildGradioInterfaceRequest (line 131) | class BuildGradioInterfaceRequest(BaseModel): class BuildGradioMediaInterfaceRequest (line 143) | class BuildGradioMediaInterfaceRequest(BaseModel): FILE: xinference/api/tests/test_admin.py function _json_body (line 26) | def _json_body(response): function mock_supervisor (line 31) | def mock_supervisor(): function mock_api (line 53) | def mock_api(mock_supervisor): function test_get_status_returns_200_and_data (line 66) | async def test_get_status_returns_200_and_data(mock_api, mock_supervisor): function test_get_status_raises_500_on_supervisor_error (line 74) | async def test_get_status_raises_500_on_supervisor_error(mock_api, mock_... function test_get_address_returns_supervisor_address (line 83) | async def test_get_address_returns_supervisor_address(mock_api): function test_get_cluster_version_returns_version (line 91) | async def test_get_cluster_version_returns_version(): function test_is_cluster_authenticated_returns_auth_flag (line 99) | async def test_is_cluster_authenticated_returns_auth_flag(mock_api): function test_login_for_access_token_returns_token (line 111) | async def test_login_for_access_token_returns_token(mock_api): function test_get_cluster_device_info_returns_data (line 127) | async def test_get_cluster_device_info_returns_data(mock_api, mock_super... function test_get_devices_count_returns_data (line 140) | async def test_get_devices_count_returns_data(mock_api, mock_supervisor): function test_get_workers_info_returns_data (line 148) | async def test_get_workers_info_returns_data(mock_api, mock_supervisor): function test_get_supervisor_info_returns_data (line 158) | async def test_get_supervisor_info_returns_data(mock_api, mock_supervisor): function test_abort_cluster_returns_result_and_does_not_kill_in_test (line 166) | async def test_abort_cluster_returns_result_and_does_not_kill_in_test( function test_list_cached_models_returns_list (line 177) | async def test_list_cached_models_returns_list(mock_api, mock_supervisor): function test_list_model_files_returns_paths (line 188) | async def test_list_model_files_returns_paths(mock_api, mock_supervisor): function test_confirm_and_remove_model_returns_result (line 203) | async def test_confirm_and_remove_model_returns_result(mock_api, mock_su... function test_list_virtual_envs_returns_list (line 213) | async def test_list_virtual_envs_returns_list(mock_api, mock_supervisor): function test_remove_virtual_env_requires_model_name (line 226) | async def test_remove_virtual_env_requires_model_name(mock_api): function test_remove_virtual_env_returns_result (line 240) | async def test_remove_virtual_env_returns_result(mock_api, mock_supervis... function test_get_progress_returns_progress (line 254) | async def test_get_progress_returns_progress(mock_api, mock_supervisor): function test_get_progress_raises_400_on_key_error (line 263) | async def test_get_progress_raises_400_on_key_error(mock_api, mock_super... FILE: xinference/api/tests/test_utils.py class DummyModel (line 21) | class DummyModel: method __init__ (line 24) | def __init__(self, uid: str): class DummySupervisor (line 28) | class DummySupervisor: method __init__ (line 31) | def __init__(self, models=None): method get_model (line 34) | async def get_model(self, model_uid: str): class TestRequireModel (line 40) | class TestRequireModel: method test_successful_get (line 44) | async def test_successful_get(self): method test_model_not_found_raises_400 (line 56) | async def test_model_not_found_raises_400(self): method test_unexpected_error_raises_500 (line 69) | async def test_unexpected_error_raises_500(self): method test_reports_error_event (line 81) | async def test_reports_error_event(self): method test_no_report_error_event_when_none (line 101) | async def test_no_report_error_event_when_none(self): FILE: xinference/api/utils.py function require_model (line 27) | async def require_model( FILE: xinference/client/common.py function convert_float_to_int_or_str (line 19) | def convert_float_to_int_or_str(model_size: float) -> Union[int, str]: function streaming_response_iterator (line 30) | def streaming_response_iterator( function async_streaming_response_iterator (line 66) | async def async_streaming_response_iterator( FILE: xinference/client/restful/async_restful_client.py function _filter_params (line 35) | def _filter_params(params: Dict[Any, Any]) -> Dict[Any, Any]: function _get_error_string (line 43) | async def _get_error_string(response: aiohttp.ClientResponse) -> str: function _release_response (line 61) | async def _release_response(response: aiohttp.ClientResponse): class AsyncRESTfulModelHandle (line 67) | class AsyncRESTfulModelHandle: method __init__ (line 73) | def __init__(self, model_uid: str, base_url: str, auth_headers: Dict): method close (line 82) | async def close(self): method __del__ (line 88) | def __del__(self): class AsyncRESTfulEmbeddingModelHandle (line 94) | class AsyncRESTfulEmbeddingModelHandle(AsyncRESTfulModelHandle): method create_embedding (line 95) | async def create_embedding( method convert_ids_to_tokens (line 136) | async def convert_ids_to_tokens( class AsyncRESTfulRerankModelHandle (line 177) | class AsyncRESTfulRerankModelHandle(AsyncRESTfulModelHandle): method rerank (line 178) | async def rerank( class AsyncRESTfulImageModelHandle (line 239) | class AsyncRESTfulImageModelHandle(AsyncRESTfulModelHandle): method text_to_image (line 240) | async def text_to_image( method image_to_image (line 287) | async def image_to_image( method image_edit (line 370) | async def image_edit( method inpainting (line 521) | async def inpainting( method ocr (line 601) | async def ocr(self, image: Union[str, bytes], **kwargs): class AsyncRESTfulVideoModelHandle (line 623) | class AsyncRESTfulVideoModelHandle(AsyncRESTfulModelHandle): method text_to_video (line 624) | async def text_to_video( method image_to_video (line 663) | async def image_to_video( method flf_to_video (line 712) | async def flf_to_video( class AsyncRESTfulGenerateModelHandle (line 780) | class AsyncRESTfulGenerateModelHandle(AsyncRESTfulModelHandle): method generate (line 781) | async def generate( class AsyncRESTfulChatModelHandle (line 835) | class AsyncRESTfulChatModelHandle(AsyncRESTfulGenerateModelHandle): method chat (line 836) | async def chat( class AsyncRESTfulAudioModelHandle (line 917) | class AsyncRESTfulAudioModelHandle(AsyncRESTfulModelHandle): method transcriptions (line 918) | async def transcriptions( method translations (line 987) | async def translations( method speech (line 1054) | async def speech( class AsyncRESTfulFlexibleModelHandle (line 1142) | class AsyncRESTfulFlexibleModelHandle(AsyncRESTfulModelHandle): method infer (line 1143) | async def infer( class AsyncClient (line 1177) | class AsyncClient: method __init__ (line 1178) | def __init__(self, base_url, api_key: Optional[str] = None): method close (line 1190) | async def close(self): method __del__ (line 1196) | def __del__(self): method _set_token (line 1201) | def _set_token(self, token: Optional[str]): method _get_token (line 1206) | def _get_token(self) -> Optional[str]: method _check_cluster_authenticated (line 1213) | def _check_cluster_authenticated(self): method vllm_models (line 1231) | async def vllm_models(self) -> Dict[str, Any]: method login (line 1248) | async def login(self, username: str, password: str): method list_models (line 1269) | async def list_models(self) -> Dict[str, Dict[str, Any]]: method launch_model (line 1293) | async def launch_model( method terminate_model (line 1410) | async def terminate_model(self, model_uid: str): method get_launch_model_progress (line 1435) | async def get_launch_model_progress(self, model_uid: str) -> dict: method cancel_launch_model (line 1465) | async def cancel_launch_model(self, model_uid: str): method get_instance_info (line 1488) | async def get_instance_info(self, model_name: str, model_uid: str): method _get_supervisor_internal_address (line 1501) | async def _get_supervisor_internal_address(self): method get_model (line 1510) | async def get_model(self, model_uid: str) -> AsyncRESTfulModelHandle: method describe_model (line 1580) | async def describe_model(self, model_uid: str): method register_model (line 1632) | async def register_model( method unregister_model (line 1672) | async def unregister_model(self, model_type: str, model_name: str): method list_model_registrations (line 1699) | async def list_model_registrations(self, model_type: str) -> List[Dict... method list_cached_models (line 1730) | async def list_cached_models( method list_deletable_models (line 1769) | async def list_deletable_models( method confirm_and_remove_model (line 1801) | async def confirm_and_remove_model( method get_model_registration (line 1833) | async def get_model_registration( method query_engine_by_model_name (line 1862) | async def query_engine_by_model_name( method abort_request (line 1899) | async def abort_request( method get_workers_info (line 1934) | async def get_workers_info(self): method get_supervisor_info (line 1945) | async def get_supervisor_info(self): method get_progress (line 1956) | async def get_progress(self, request_id: str): method abort_cluster (line 1967) | async def abort_cluster(self): FILE: xinference/client/restful/restful_client.py function _get_error_string (line 34) | def _get_error_string(response: requests.Response) -> str: class RESTfulModelHandle (line 47) | class RESTfulModelHandle: method __init__ (line 53) | def __init__(self, model_uid: str, base_url: str, auth_headers: Dict): method close (line 59) | def close(self): method __del__ (line 67) | def __del__(self): class RESTfulEmbeddingModelHandle (line 72) | class RESTfulEmbeddingModelHandle(RESTfulModelHandle): method create_embedding (line 73) | def create_embedding(self, input: Union[str, List[str]], **kwargs) -> ... method convert_ids_to_tokens (line 109) | def convert_ids_to_tokens( class RESTfulRerankModelHandle (line 147) | class RESTfulRerankModelHandle(RESTfulModelHandle): method rerank (line 148) | def rerank( class RESTfulImageModelHandle (line 206) | class RESTfulImageModelHandle(RESTfulModelHandle): method text_to_image (line 207) | def text_to_image( method image_to_image (line 251) | def image_to_image( method image_edit (line 332) | def image_edit( method inpainting (line 463) | def inpainting( method ocr (line 538) | def ocr(self, image: Union[str, bytes], **kwargs): class RESTfulVideoModelHandle (line 558) | class RESTfulVideoModelHandle(RESTfulModelHandle): method text_to_video (line 559) | def text_to_video( method image_to_video (line 595) | def image_to_video( method flf_to_video (line 642) | def flf_to_video( class RESTfulGenerateModelHandle (line 696) | class RESTfulGenerateModelHandle(RESTfulModelHandle): method generate (line 697) | def generate( class RESTfulChatModelHandle (line 751) | class RESTfulChatModelHandle(RESTfulGenerateModelHandle): method chat (line 752) | def chat( class RESTfulAudioModelHandle (line 832) | class RESTfulAudioModelHandle(RESTfulModelHandle): method transcriptions (line 833) | def transcriptions( method translations (line 898) | def translations( method speech (line 961) | def speech( class RESTfulFlexibleModelHandle (line 1042) | class RESTfulFlexibleModelHandle(RESTfulModelHandle): method infer (line 1043) | def infer( class Client (line 1079) | class Client: method __init__ (line 1080) | def __init__(self, base_url, api_key: Optional[str] = None): method close (line 1089) | def close(self): method __del__ (line 1097) | def __del__(self): method _set_token (line 1101) | def _set_token(self, token: Optional[str]): method _get_token (line 1106) | def _get_token(self) -> Optional[str]: method _check_cluster_authenticated (line 1113) | def _check_cluster_authenticated(self): method vllm_models (line 1127) | def vllm_models(self) -> Dict[str, Any]: method login (line 1140) | def login(self, username: str, password: str): method list_models (line 1156) | def list_models(self) -> Dict[str, Dict[str, Any]]: method launch_model (line 1179) | def launch_model( method terminate_model (line 1308) | def terminate_model(self, model_uid: str): method get_launch_model_progress (line 1332) | def get_launch_model_progress(self, model_uid: str) -> dict: method cancel_launch_model (line 1360) | def cancel_launch_model(self, model_uid: str): method get_instance_info (line 1382) | def get_instance_info(self, model_name: str, model_uid: str): method _get_supervisor_internal_address (line 1394) | def _get_supervisor_internal_address(self): method get_model (line 1402) | def get_model(self, model_uid: str) -> RESTfulModelHandle: method describe_model (line 1472) | def describe_model(self, model_uid: str): method register_model (line 1522) | def register_model( method unregister_model (line 1559) | def unregister_model(self, model_type: str, model_name: str): method list_model_registrations (line 1585) | def list_model_registrations( method list_cached_models (line 1619) | def list_cached_models( method list_deletable_models (line 1657) | def list_deletable_models( method confirm_and_remove_model (line 1687) | def confirm_and_remove_model( method get_model_registration (line 1717) | def get_model_registration( method query_engine_by_model_name (line 1745) | def query_engine_by_model_name( method abort_request (line 1781) | def abort_request(self, model_uid: str, request_id: str, block_duratio... method get_workers_info (line 1813) | def get_workers_info(self): method get_supervisor_info (line 1823) | def get_supervisor_info(self): method get_progress (line 1833) | def get_progress(self, request_id: str): method abort_cluster (line 1843) | def abort_cluster(self): FILE: xinference/client/tests/test_async_client.py class _DummyAsyncResponse (line 30) | class _DummyAsyncResponse: method json (line 33) | async def json(self): method release (line 36) | def release(self): method wait_for_close (line 39) | async def wait_for_close(self): class _DummyAsyncSession (line 43) | class _DummyAsyncSession: method __init__ (line 44) | def __init__(self): method post (line 47) | async def post(self, url, json=None, headers=None): method close (line 51) | async def close(self): function test_async_RESTful_client (line 57) | async def test_async_RESTful_client(setup): function test_async_query_engines_by_name (line 184) | async def test_async_query_engines_by_name(setup): function test_async_list_cached_models (line 199) | async def test_async_list_cached_models(setup): function test_async_RESTful_client_for_embedding (line 208) | async def test_async_RESTful_client_for_embedding(setup): function test_async_RESTful_client_custom_model (line 229) | async def test_async_RESTful_client_custom_model(setup): function test_async_client_from_modelscope (line 370) | async def test_async_client_from_modelscope(setup): function test_async_client_custom_embedding_model (line 395) | async def test_async_client_custom_embedding_model(setup): function test_async_rerank (line 448) | async def test_async_rerank(setup): function set_auto_recover_limit (line 509) | def set_auto_recover_limit(): function set_test_oom_error (line 516) | def set_test_oom_error(): function setup_cluster (line 523) | def setup_cluster(): function test_auto_recover (line 558) | async def test_auto_recover(set_auto_recover_limit, setup_cluster): function test_model_error (line 598) | async def test_model_error(set_test_oom_error, setup_cluster): function test_async_restful_chat_enable_thinking_injected (line 620) | async def test_async_restful_chat_enable_thinking_injected(): FILE: xinference/client/tests/test_async_client_with_auth.py function test_async_client_auth (line 22) | async def test_async_client_auth(setup_with_auth): FILE: xinference/client/tests/test_client.py class _DummyResponse (line 33) | class _DummyResponse: method json (line 36) | def json(self): class _DummySession (line 40) | class _DummySession: method __init__ (line 41) | def __init__(self): method post (line 44) | def post(self, url, json=None, stream=None, headers=None): method close (line 48) | def close(self): function test_RESTful_client (line 53) | def test_RESTful_client(setup): function test_query_engines_by_name (line 192) | def test_query_engines_by_name(setup): function test_list_cached_models (line 202) | def test_list_cached_models(setup): function test_RESTful_client_for_embedding (line 209) | def test_RESTful_client_for_embedding(setup): function test_RESTful_client_custom_model (line 227) | def test_RESTful_client_custom_model(setup): function test_client_from_modelscope (line 360) | def test_client_from_modelscope(setup): function test_client_error (line 380) | def test_client_error(): function test_client_custom_embedding_model (line 392) | def test_client_custom_embedding_model(setup): function set_auto_recover_limit (line 442) | def set_auto_recover_limit(): function set_test_oom_error (line 449) | def set_test_oom_error(): function setup_cluster (line 456) | def setup_cluster(): function test_auto_recover (line 490) | def test_auto_recover(set_auto_recover_limit, setup_cluster): function test_model_error (line 528) | def test_model_error(set_test_oom_error, setup_cluster): function test_restful_chat_enable_thinking_injected (line 548) | def test_restful_chat_enable_thinking_injected(): FILE: xinference/client/tests/test_client_with_auth.py function test_client_auth (line 21) | def test_client_auth(setup_with_auth): FILE: xinference/conftest.py function api_health_check (line 104) | def api_health_check(endpoint: str, max_attempts: int, sleep_interval: i... function _start_test_cluster (line 128) | async def _start_test_cluster( function run_test_cluster (line 154) | def run_test_cluster(address: str, logging_conf: Optional[Dict] = None): function run_test_cluster_in_subprocess (line 167) | def run_test_cluster_in_subprocess( function setup (line 179) | def setup(): function setup_with_file_logging (line 211) | def setup_with_file_logging(): function setup_with_auth (line 243) | def setup_with_auth(): FILE: xinference/constants.py function get_xinference_home (line 61) | def get_xinference_home() -> str: FILE: xinference/core/cache_tracker.py class CacheTrackerActor (line 22) | class CacheTrackerActor(xo.Actor): method __init__ (line 23) | def __init__(self): method default_uid (line 28) | def default_uid(cls) -> str: method _map_address_to_file_location (line 32) | def _map_address_to_file_location( method _update_file_location (line 44) | def _update_file_location(data: Dict, origin_version_info: Dict): method record_model_version (line 51) | def record_model_version(self, version_info: Dict[str, List[Dict]], ad... method update_cache_status (line 72) | def update_cache_status( method unregister_model_version (line 91) | def unregister_model_version(self, model_name: str): method get_model_versions (line 94) | def get_model_versions(self, model_name: str) -> List[Dict]: method get_model_version_count (line 101) | def get_model_version_count(self, model_name: str) -> int: method list_cached_models (line 104) | def list_cached_models( method list_deletable_models (line 126) | def list_deletable_models(self, model_version: str, worker_ip: str) ->... method confirm_and_remove_model (line 140) | def confirm_and_remove_model(self, model_version: str, worker_ip: str): FILE: xinference/core/event.py class EventType (line 24) | class EventType(Enum): class Event (line 30) | class Event(TypedDict): class EventCollectorActor (line 36) | class EventCollectorActor(xo.StatelessActor): method __init__ (line 37) | def __init__(self): method default_uid (line 44) | def default_uid(cls) -> str: method get_model_events (line 47) | def get_model_events(self, model_uid: str) -> List[Dict]: method report_event (line 54) | def report_event(self, model_uid: str, event: Event): FILE: xinference/core/launch_strategy.py class LaunchStrategy (line 25) | class LaunchStrategy(ABC): method select_worker (line 31) | def select_worker( class IdleFirstLaunchStrategy (line 47) | class IdleFirstLaunchStrategy(LaunchStrategy): method __init__ (line 53) | def __init__(self, worker_status: Dict[str, "WorkerStatus"]): method _select_least_loaded_gpu (line 57) | def _select_least_loaded_gpu( method _reserve_slot (line 99) | def _reserve_slot( method select_worker (line 114) | def select_worker( FILE: xinference/core/metrics.py function record_metrics (line 42) | def record_metrics(name, op, kwargs): function launch_metrics_export_server (line 47) | def launch_metrics_export_server(q, host=None, port=None): FILE: xinference/core/model.py class _OutOfMemoryError (line 61) | class _OutOfMemoryError(Exception): function register_batching_multimodal_models (line 76) | def register_batching_multimodal_models(*model_names: str): function request_limit (line 86) | def request_limit(fn): function oom_check (line 122) | def oom_check(fn): class ModelActor (line 153) | class ModelActor(xo.StatelessActor, CancelMixin): method __pre_destroy__ (line 156) | async def __pre_destroy__(self): method __init__ (line 195) | def __init__( method __post_create__ (line 245) | async def __post_create__(self): method __repr__ (line 254) | def __repr__(self) -> str: method __getattr__ (line 257) | def __getattr__(self, attr: str): method decrease_serve_count (line 260) | def decrease_serve_count(self): method start_transfer_for_vllm (line 264) | async def start_transfer_for_vllm(self, rank_addresses: List[str]): method _record_completion_metrics (line 286) | async def _record_completion_metrics( method _get_worker_ref (line 323) | async def _get_worker_ref(self) -> xo.ActorRefType["WorkerActor"]: method _get_progress_tracker_ref (line 332) | async def _get_progress_tracker_ref( method _get_progressor (line 343) | async def _get_progressor(self, request_id: str): method is_vllm_backend (line 354) | def is_vllm_backend(self) -> bool: method is_sglang_backend (line 359) | def is_sglang_backend(self) -> bool: method load (line 364) | async def load(self): method wait_for_load (line 393) | async def wait_for_load(self): method need_create_pools (line 397) | def need_create_pools(self): method set_pool_addresses (line 400) | def set_pool_addresses(self, pool_addresses: List[str]): method get_pool_addresses (line 404) | def get_pool_addresses(self) -> Optional[List[str]]: method set_worker_addresses (line 409) | def set_worker_addresses(self, shard: int, worker_addresses: List[str]): method model_uid (line 413) | def model_uid(self): method get_driver_info (line 424) | def get_driver_info(self): method stop (line 430) | async def stop(self): method _handle_oom_error (line 436) | async def _handle_oom_error(self, ex): method _to_generator (line 447) | def _to_generator(self, output_type: str, gen: types.GeneratorType): method _to_async_gen (line 486) | async def _to_async_gen(self, output_type: str, gen: types.AsyncGenera... method _handle_pending_requests (line 527) | async def _handle_pending_requests(self): method _call_wrapper_json (line 568) | async def _call_wrapper_json(self, fn: Callable, *args, **kwargs): method _call_wrapper_binary (line 571) | async def _call_wrapper_binary(self, fn: Callable, *args, **kwargs): method _call_wrapper (line 575) | async def _call_wrapper(self, output_type: str, fn: Callable, *args, *... method generate (line 643) | async def generate(self, prompt: str, *args, **kwargs): method chat (line 669) | async def chat(self, messages: List[Dict], *args, **kwargs): method abort_request (line 715) | async def abort_request( method create_embedding (line 736) | async def create_embedding(self, input: Union[str, List[str]], *args, ... method convert_ids_to_tokens (line 749) | async def convert_ids_to_tokens( method rerank (line 762) | async def rerank( method transcriptions (line 790) | async def transcriptions( method translations (line 818) | async def translations( method speech (line 846) | async def speech( method text_to_image (line 872) | async def text_to_image( method txt2img (line 901) | async def txt2img( method image_to_image (line 920) | async def image_to_image( method img2img (line 953) | async def img2img( method inpainting (line 972) | async def inpainting( method ocr (line 1009) | async def ocr( method infer (line 1026) | async def infer( method text_to_video (line 1044) | async def text_to_video( method image_to_video (line 1069) | async def image_to_video( method flf_to_video (line 1098) | async def flf_to_video( method record_metrics (line 1127) | async def record_metrics(self, name, op, kwargs): method get_pending_requests_count (line 1131) | async def get_pending_requests_count(self): FILE: xinference/core/otel.py function setup_otel (line 49) | def setup_otel( function _build_headers (line 150) | def _build_headers(api_key: str) -> Optional[dict]: function _setup_tracing (line 157) | def _setup_tracing( function _build_span_exporter (line 197) | def _build_span_exporter( function _setup_metrics (line 230) | def _setup_metrics( function _build_metric_exporter (line 260) | def _build_metric_exporter( function _instrument_fastapi (line 292) | def _instrument_fastapi(app) -> None: # type: ignore[type-arg] class ClusterMetricsCollector (line 305) | class ClusterMetricsCollector: method __init__ (line 324) | def __init__(self) -> None: method update (line 328) | def update(self, worker_address: str, node_info: dict) -> None: method remove_worker (line 332) | def remove_worker(self, worker_address: str) -> None: method register (line 336) | def register(self) -> None: method _cpu_utilization_cb (line 393) | def _cpu_utilization_cb(self, options): # type: ignore[no-untyped-def] method _cpu_count_cb (line 401) | def _cpu_count_cb(self, options): # type: ignore[no-untyped-def] method _memory_used_cb (line 411) | def _memory_used_cb(self, options): # type: ignore[no-untyped-def] method _memory_total_cb (line 419) | def _memory_total_cb(self, options): # type: ignore[no-untyped-def] method _gpu_utilization_cb (line 429) | def _gpu_utilization_cb(self, options): # type: ignore[no-untyped-def] method _gpu_mem_used_cb (line 445) | def _gpu_mem_used_cb(self, options): # type: ignore[no-untyped-def] method _gpu_mem_total_cb (line 461) | def _gpu_mem_total_cb(self, options): # type: ignore[no-untyped-def] method _gpu_mem_free_cb (line 477) | def _gpu_mem_free_cb(self, options): # type: ignore[no-untyped-def] function get_cluster_metrics_collector (line 498) | def get_cluster_metrics_collector() -> Optional[ClusterMetricsCollector]: FILE: xinference/core/progress_tracker.py class _ProgressInfo (line 39) | class _ProgressInfo: class ProgressTrackerActor (line 45) | class ProgressTrackerActor(xo.StatelessActor): method default_uid (line 49) | def default_uid(cls) -> str: method __init__ (line 52) | def __init__( method __post_create__ (line 64) | async def __post_create__(self): method __pre_destroy__ (line 67) | async def __pre_destroy__(self): method _clear_finished (line 71) | async def _clear_finished(self): method start (line 95) | def start(self, request_id: str, info: Optional[str] = None): method set_progress (line 100) | def set_progress( method get_progress (line 113) | def get_progress(self, request_id: str) -> float: method get_progress_info (line 116) | def get_progress_info(self, request_id: str) -> Tuple[float, Optional[... class Progressor (line 121) | class Progressor: method __init__ (line 124) | def __init__( method start (line 144) | async def start(self): method split_stages (line 148) | def split_stages(self, n_stage: int, stage_weight: Optional[List[float... method __enter__ (line 165) | def __enter__(self): method __exit__ (line 172) | def __exit__(self, exc_type, exc_val, exc_tb): method set_progress (line 180) | def set_progress(self, progress: float, info: Optional[str] = None): FILE: xinference/core/resource.py class ResourceStatus (line 24) | class ResourceStatus: class GPUStatus (line 33) | class GPUStatus: function gather_node_info (line 42) | def gather_node_info() -> Dict[str, Union[ResourceStatus, GPUStatus]]: FILE: xinference/core/status_guard.py class LaunchStatus (line 25) | class LaunchStatus(Enum): class ReplicaStatus (line 34) | class ReplicaStatus(BaseModel): class InstanceInfo (line 45) | class InstanceInfo(BaseModel): method update (line 56) | def update(self, **kwargs): class StatusGuardActor (line 61) | class StatusGuardActor(xo.StatelessActor): method __init__ (line 62) | def __init__(self): method default_uid (line 67) | def default_uid(cls) -> str: method _drop_terminated_info (line 71) | def _drop_terminated_info(instance_infos: List[InstanceInfo]) -> List[... method set_instance_info (line 78) | def set_instance_info(self, model_uid: str, info: InstanceInfo): method get_instance_info (line 81) | def get_instance_info( method get_instance_count (line 100) | def get_instance_count(self, model_name: str) -> int: method update_instance_info (line 103) | def update_instance_info(self, model_uid: str, info: Dict): method update_replica_status (line 106) | def update_replica_status( method get_replica_statuses (line 141) | def get_replica_statuses(self, model_uid: str) -> List[ReplicaStatus]: FILE: xinference/core/supervisor.py function callback_for_async_launch (line 88) | def callback_for_async_launch(model_uid: str): class WorkerStatus (line 94) | class WorkerStatus: class ReplicaInfo (line 101) | class ReplicaInfo: class SupervisorActor (line 109) | class SupervisorActor(xo.StatelessActor): method __init__ (line 110) | def __init__(self): method default_uid (line 126) | def default_uid(cls) -> str: method _get_worker_ref_by_ip (line 129) | def _get_worker_ref_by_ip( method __post_create__ (line 138) | async def __post_create__(self): method get_cluster_device_info (line 307) | async def get_cluster_device_info(self, detailed: bool = False) -> List: method get_builtin_prompts (line 355) | async def get_builtin_prompts() -> Dict[str, Any]: method get_builtin_families (line 361) | async def get_builtin_families() -> Dict[str, List[str]]: method get_devices_count (line 385) | async def get_devices_count(self) -> int: method _choose_worker (line 415) | async def _choose_worker( method get_status (line 439) | def get_status(self) -> Dict: method _get_spec_dicts (line 445) | def _get_spec_dicts( method _to_llm_reg (line 465) | async def _to_llm_reg( method _to_embedding_model_reg (line 489) | async def _to_embedding_model_reg( method _to_rerank_model_reg (line 516) | async def _to_rerank_model_reg( method _to_image_model_reg (line 543) | async def _to_image_model_reg( method _to_audio_model_reg (line 578) | async def _to_audio_model_reg( method _to_video_model_reg (line 613) | async def _to_video_model_reg( method _to_flexible_model_reg (line 648) | async def _to_flexible_model_reg( method list_model_registrations (line 670) | async def list_model_registrations( method get_model_registration (line 695) | async def get_model_registration(self, model_type: str, model_name: st... method query_engines_by_model_name (line 706) | async def query_engines_by_model_name( method register_model (line 734) | async def register_model( method _sync_register_model (line 802) | async def _sync_register_model( method unregister_model (line 827) | async def unregister_model(self, model_type: str, model_name: str): method update_model_type (line 841) | async def update_model_type(self, model_type: str): method _gen_model_uid (line 876) | def _gen_model_uid(self, model_name: str) -> str: method get_model_versions (line 884) | async def get_model_versions(self, model_type: str, model_name: str) -... method get_model_version_count (line 887) | async def get_model_version_count(self, model_name: str) -> int: method launch_model_by_version (line 891) | async def launch_model_by_version( method _get_worker_refs_by_ip (line 923) | def _get_worker_refs_by_ip(self, ip: str) -> List[xo.ActorRefType["Wor... method launch_builtin_model (line 937) | async def launch_builtin_model( method _launch_builtin_sharded_model (line 1396) | async def _launch_builtin_sharded_model( method get_launch_builtin_model_progress (line 1557) | async def get_launch_builtin_model_progress(self, model_uid: str) -> f... method cancel_launch_builtin_model (line 1576) | async def cancel_launch_builtin_model(self, model_uid: str): method get_instance_info (line 1599) | async def get_instance_info( method get_replica_statuses (line 1607) | async def get_replica_statuses(self, model_uid: str) -> List[Dict]: method get_instance_count (line 1622) | async def get_instance_count(self, model_name: str) -> int: method _check_dead_nodes (line 1625) | async def _check_dead_nodes(self): method terminate_model (line 1679) | async def terminate_model(self, model_uid: str, suppress_exception=Fal... method get_model (line 1740) | async def get_model(self, model_uid: str) -> xo.ActorRefType["ModelAct... method get_model_status (line 1763) | async def get_model_status(self, replica_model_uid: str): method describe_model (line 1778) | async def describe_model(self, model_uid: str) -> Dict[str, Any]: method list_models (line 1801) | async def list_models(self) -> Dict[str, Dict[str, Any]]: method is_local_deployment (line 1813) | def is_local_deployment(self) -> bool: method list_cached_models (line 1821) | async def list_cached_models( method abort_request (line 1849) | async def abort_request( method add_worker (line 1886) | async def add_worker(self, worker_address: str): method remove_worker (line 1900) | async def remove_worker(self, worker_address: str): method report_worker_status (line 1928) | async def report_worker_status( method list_deletable_models (line 1957) | async def list_deletable_models( method confirm_and_remove_model (line 1982) | async def confirm_and_remove_model( method list_virtual_envs (line 2008) | async def list_virtual_envs( method list_virtual_env_packages (line 2043) | async def list_virtual_env_packages( method remove_virtual_env (line 2082) | async def remove_virtual_env( method get_workers_info (line 2135) | async def get_workers_info(self) -> List[Dict[str, Any]]: method get_supervisor_info (line 2141) | async def get_supervisor_info(self) -> Dict[str, Any]: method trigger_exit (line 2147) | async def trigger_exit(self) -> bool: method abort_cluster (line 2155) | async def abort_cluster(self) -> bool: method record_metrics (line 2164) | def record_metrics(name, op, kwargs): method get_progress (line 2167) | async def get_progress(self, request_id: str) -> float: method call_collective_manager (line 2170) | async def call_collective_manager( FILE: xinference/core/tests/test_continuous_batching.py class BaseThread (line 27) | class BaseThread(threading.Thread): method __init__ (line 28) | def __init__(self): method run_internal (line 32) | def run_internal(self): method run (line 35) | def run(self): method join (line 41) | def join(self, timeout=None): class InferenceThread (line 47) | class InferenceThread(BaseThread): method __init__ (line 48) | def __init__(self, prompt, generate_config, client, model): method stream (line 57) | def stream(self): method run_internal (line 60) | def run_internal(self): class InferenceThreadWithError (line 79) | class InferenceThreadWithError(InferenceThread): method __init__ (line 80) | def __init__(self, prompt, generate_config, client, model, sleep=None): method run_internal (line 84) | def run_internal(self): class AbortThread (line 98) | class AbortThread(BaseThread): method __init__ (line 99) | def __init__(self, client, model_uid, request_id, expected_res, sleep=... method run_internal (line 107) | def run_internal(self): function test_continuous_batching (line 118) | def test_continuous_batching(setup): FILE: xinference/core/tests/test_launch_strategy.py class DummyRef (line 23) | class DummyRef: method __init__ (line 24) | def __init__(self, address: str): class DummyWorkerRef (line 28) | class DummyWorkerRef: method __init__ (line 29) | def __init__(self, address: str, model_count: int, launched: list): method get_model_count (line 34) | async def get_model_count(self) -> int: method launch_builtin_model (line 37) | async def launch_builtin_model(self, *args, **kwargs): method wait_for_load (line 43) | async def wait_for_load(self, model_uid: str): class DummyStatusGuard (line 47) | class DummyStatusGuard: method __init__ (line 48) | def __init__(self): method set_instance_info (line 51) | async def set_instance_info(self, model_uid: str, instance_info): method update_instance_info (line 54) | async def update_instance_info(self, model_uid: str, updates: dict): function test_assign_replica_gpu_single_slot_reused (line 58) | def test_assign_replica_gpu_single_slot_reused(): function test_assign_replica_gpu_slicing (line 64) | def test_assign_replica_gpu_slicing(): function test_idle_first_prefers_empty_gpu (line 71) | def test_idle_first_prefers_empty_gpu(monkeypatch): function test_idle_first_balances_with_reserve (line 91) | def test_idle_first_balances_with_reserve(monkeypatch): function test_idle_first_fallback_to_count_when_no_alloc (line 113) | def test_idle_first_fallback_to_count_when_no_alloc(): function test_multi_worker_multi_gpu_even_distribution (line 127) | def test_multi_worker_multi_gpu_even_distribution(): function test_cpu_fallback_no_gpu_alloc (line 169) | def test_cpu_fallback_no_gpu_alloc(): function test_idle_first_multi_gpu_single_worker (line 184) | def test_idle_first_multi_gpu_single_worker(): function test_idle_first_multi_gpu_two_workers (line 204) | def test_idle_first_multi_gpu_two_workers(): function test_distributed_launch_avoids_same_worker_for_shards (line 234) | async def test_distributed_launch_avoids_same_worker_for_shards(): FILE: xinference/core/tests/test_metrics.py function setup_cluster (line 21) | def setup_cluster(): function test_metrics_exporter_server (line 57) | async def test_metrics_exporter_server(setup_cluster): function disable_metrics (line 95) | def disable_metrics(): function test_disable_metrics_exporter_server (line 104) | async def test_disable_metrics_exporter_server(disable_metrics, setup_cl... function test_metrics_exporter_data (line 128) | async def test_metrics_exporter_data(setup_cluster): FILE: xinference/core/tests/test_model.py class MockModelFamily (line 28) | class MockModelFamily: method to_description (line 29) | def to_description(self) -> dict: class MockModel (line 33) | class MockModel: method __init__ (line 34) | def __init__(self): method generate (line 37) | async def generate(self, prompt, **kwargs): class MockModelActor (line 46) | class MockModelActor(ModelActor): method __init__ (line 47) | def __init__( method __pre_destroy__ (line 61) | async def __pre_destroy__(self): method record_metrics (line 64) | async def record_metrics(self, name, op, kwargs): function setup_pool (line 69) | async def setup_pool(): function test_concurrent_call (line 78) | async def test_concurrent_call(setup_pool): FILE: xinference/core/tests/test_progressor.py function test_progressor (line 25) | async def test_progressor(): FILE: xinference/core/tests/test_restful_api.py class _DummyRequest (line 30) | class _DummyRequest: method __init__ (line 31) | def __init__(self, payload): method json (line 34) | async def json(self): function test_restful_api (line 39) | async def test_restful_api(setup): function test_restful_api_for_embedding (line 325) | def test_restful_api_for_embedding(setup): function _check_invalid_tool_calls (line 398) | def _check_invalid_tool_calls(endpoint, model_uid_res): function test_restful_api_for_tool_calls (line 449) | def test_restful_api_for_tool_calls(setup, model_format, quantization): function test_restful_api_for_llama3_tool_calls (line 628) | def test_restful_api_for_llama3_tool_calls(setup, model_format, quantiza... function test_restful_api_for_gorilla_openfunctions_tool_calls (line 719) | def test_restful_api_for_gorilla_openfunctions_tool_calls( function test_restful_api_for_qwen_tool_calls (line 820) | def test_restful_api_for_qwen_tool_calls(setup, model_format, quantizati... function test_restful_api_with_request_limits (line 1040) | def test_restful_api_with_request_limits(setup): function test_openai (line 1106) | async def test_openai(setup): function test_lang_chain (line 1169) | def test_lang_chain(setup): function test_chat_completion_enable_thinking_injected (line 1265) | async def test_chat_completion_enable_thinking_injected(payload, expected): function test_launch_model_async (line 1291) | def test_launch_model_async(setup): function test_cancel_launch_model (line 1333) | def test_cancel_launch_model(setup): function test_events (line 1372) | def test_events(setup): function test_launch_model_by_version (line 1412) | def test_launch_model_by_version(setup): function test_builtin_families (line 1448) | def test_builtin_families(setup): function anthropic_setup (line 1469) | def anthropic_setup(): function test_convert_openai_to_anthropic_with_tools (line 1528) | def test_convert_openai_to_anthropic_with_tools(anthropic_setup): function test_convert_openai_to_anthropic_without_tools (line 1555) | def test_convert_openai_to_anthropic_without_tools(anthropic_setup): function test_convert_openai_to_anthropic_mixed_content (line 1579) | def test_convert_openai_to_anthropic_mixed_content(anthropic_setup): function test_convert_openai_to_anthropic_multiple_tools (line 1628) | def test_convert_openai_to_anthropic_multiple_tools(anthropic_setup): function test_convert_openai_to_anthropic_empty_response (line 1684) | def test_convert_openai_to_anthropic_empty_response(anthropic_setup): function test_convert_openai_to_anthropic_invalid_tool_arguments (line 1698) | def test_convert_openai_to_anthropic_invalid_tool_arguments(anthropic_se... function test_anthropic_tools_response_format (line 1737) | def test_anthropic_tools_response_format(anthropic_setup): function anthropic_api (line 1778) | def anthropic_api(): function mock_supervisor (line 1786) | def mock_supervisor(): function sample_models (line 1793) | def sample_models(): function test_anthropic_list_models (line 1816) | async def test_anthropic_list_models(anthropic_api, mock_supervisor, sam... function test_anthropic_get_model_found (line 1838) | async def test_anthropic_get_model_found(anthropic_api, mock_supervisor,... function test_anthropic_models_format_compatibility (line 1860) | async def test_anthropic_models_format_compatibility( function test_anthropic_models_include_original_fields (line 1892) | async def test_anthropic_models_include_original_fields( FILE: xinference/core/tests/test_types.py function check_fields (line 25) | def check_fields(a, b): function test_create_completion_types (line 48) | def test_create_completion_types(): function test_create_chat_completion_types (line 68) | def test_create_chat_completion_types(): function test_openai_requests (line 91) | def test_openai_requests(): function test_create_message_with_tools (line 135) | def test_create_message_with_tools(): function test_create_message_without_tools (line 176) | def test_create_message_without_tools(): function test_create_message_with_tool_choice_function (line 197) | def test_create_message_with_tool_choice_function(): function test_create_message_with_optional_fields (line 229) | def test_create_message_with_optional_fields(): function test_model_and_messages_type (line 256) | def test_model_and_messages_type(): function test_message_create_params_structure (line 275) | def test_message_create_params_structure(): FILE: xinference/core/tests/test_utils.py function test_replica_model_uid (line 23) | def test_replica_model_uid(): class DummyVirtualEnvManager (line 35) | class DummyVirtualEnvManager: method __init__ (line 36) | def __init__(self, python_path: str): method get_python_path (line 39) | def get_python_path(self) -> str: function test_build_subpool_envs_for_virtual_env_disabled (line 43) | def test_build_subpool_envs_for_virtual_env_disabled(): function test_build_subpool_envs_for_virtual_env_enabled (line 51) | def test_build_subpool_envs_for_virtual_env_enabled(): FILE: xinference/core/tests/test_worker.py class MockWorkerActor (line 26) | class MockWorkerActor(WorkerActor): method __init__ (line 27) | def __init__( method __post_create__ (line 35) | async def __post_create__(self): method __pre_destroy__ (line 38) | async def __pre_destroy__(self): method get_gpu_to_model_uid (line 41) | def get_gpu_to_model_uid(self): method get_user_specified_gpu_to_model_uids (line 44) | def get_user_specified_gpu_to_model_uids(self): method set_allow_multi_replica_per_gpu (line 47) | def set_allow_multi_replica_per_gpu(self, allow: bool): method is_model_vllm_backend (line 50) | async def is_model_vllm_backend(self, model_uid): method launch_builtin_model (line 62) | async def launch_builtin_model( method terminate_model (line 79) | async def terminate_model(self, model_uid: str): function setup_pool (line 88) | async def setup_pool(): function test_allocate_cuda_devices (line 97) | async def test_allocate_cuda_devices(setup_pool): function test_terminate_model_flag (line 124) | async def test_terminate_model_flag(setup_pool): function test_merge_virtual_env_packages_override_and_append (line 173) | def test_merge_virtual_env_packages_override_and_append(): class DummyVirtualEnvManager (line 191) | class DummyVirtualEnvManager: method __init__ (line 192) | def __init__(self): method install_packages (line 196) | def install_packages(self, packages, **kwargs): function test_prepare_virtual_env_injects_engine_vars (line 200) | def test_prepare_virtual_env_injects_engine_vars(): function test_prepare_virtual_env_without_engine_vars (line 217) | def test_prepare_virtual_env_without_engine_vars(): function test_prepare_virtual_env_inherit_pip_config (line 233) | def test_prepare_virtual_env_inherit_pip_config(monkeypatch): function test_prepare_virtual_env_keeps_system_markers (line 254) | def test_prepare_virtual_env_keeps_system_markers(): function test_launch_embedding_model (line 280) | async def test_launch_embedding_model(setup_pool): function test_launch_model_with_gpu_idx (line 350) | async def test_launch_model_with_gpu_idx(setup_pool): FILE: xinference/core/utils.py class AbortRequestMessage (line 37) | class AbortRequestMessage(Enum): function truncate_log_arg (line 43) | def truncate_log_arg(arg) -> str: function log_async (line 50) | def log_async( function log_sync (line 119) | def log_sync(logger, level=logging.DEBUG, log_exception=True): function iter_replica_model_uid (line 160) | def iter_replica_model_uid(model_uid: str, replica: int) -> Generator[st... function build_replica_model_uid (line 169) | def build_replica_model_uid(model_uid: str, rep_id: int) -> str: function parse_replica_model_uid (line 176) | def parse_replica_model_uid(replica_model_uid: str) -> Tuple[str, int]: function is_valid_model_uid (line 188) | def is_valid_model_uid(model_uid: str) -> bool: function gen_random_string (line 195) | def gen_random_string(length: int) -> str: function json_dumps (line 199) | def json_dumps(o): function purge_dir (line 208) | def purge_dir(d): function parse_model_version (line 223) | def parse_model_version(model_version: str, model_type: str) -> Tuple: function merge_virtual_env_packages (line 252) | def merge_virtual_env_packages( function build_subpool_envs_for_virtual_env (line 295) | def build_subpool_envs_for_virtual_env( function apply_engine_virtualenv_settings (line 318) | def apply_engine_virtualenv_settings( function filter_virtualenv_packages_by_markers (line 340) | def filter_virtualenv_packages_by_markers( function assign_replica_gpu (line 419) | def assign_replica_gpu( class CancelMixin (line 439) | class CancelMixin: method __init__ (line 442) | def __init__(self): method _add_running_task (line 447) | def _add_running_task(self, request_id: Optional[str]): method _cancel_running_task (line 462) | def _cancel_running_task( FILE: xinference/core/virtual_env_manager.py function get_engine_virtualenv_packages (line 79) | def get_engine_virtualenv_packages(model_engine: Optional[str]) -> List[... function get_engine_virtualenv_extra_index_urls (line 85) | def get_engine_virtualenv_extra_index_urls( function get_engine_virtualenv_index_strategy (line 98) | def get_engine_virtualenv_index_strategy(model_engine: Optional[str]) ->... function resolve_virtualenv_python_path (line 104) | def resolve_virtualenv_python_path(virtual_env_manager: Any) -> Optional... function expand_engine_dependency_placeholders (line 129) | def expand_engine_dependency_placeholders( class VirtualEnvManager (line 157) | class VirtualEnvManager: method __init__ (line 165) | def __init__(self, worker_address: str): method list_virtual_envs (line 174) | def list_virtual_envs( method remove_virtual_env (line 231) | def remove_virtual_env( method check_virtual_env_exists (line 390) | def check_virtual_env_exists(self, model_name: str) -> Dict[str, Any]: method list_virtual_env_packages (line 403) | def list_virtual_env_packages(self, model_name: str) -> Dict[str, Any]: method _detect_python_version (line 421) | def _detect_python_version(self, env_path: str) -> str: method _is_valid_python_version (line 476) | def _is_valid_python_version(self, python_version: str) -> bool: FILE: xinference/core/worker.py class ModelStatus (line 110) | class ModelStatus: class LaunchInfo (line 115) | class LaunchInfo: class WorkerActor (line 125) | class WorkerActor(xo.StatelessActor): method __init__ (line 126) | def __init__( method recover_sub_pool (line 206) | async def recover_sub_pool(self, address): method default_uid (line 262) | def default_uid(cls) -> str: method _get_spec_dicts_with_cache_status (line 265) | def _get_spec_dicts_with_cache_status( method _prefer_model_hub (line 287) | def _prefer_model_hub(self, model_family: Any, preferred_hub: str = "h... method __post_create__ (line 307) | async def __post_create__(self): method __pre_destroy__ (line 433) | async def __pre_destroy__(self): method trigger_exit (line 436) | async def trigger_exit(self) -> bool: method get_supervisor_ref (line 444) | async def get_supervisor_ref(self, add_worker: bool = True) -> xo.Acto... method get_devices_count (line 500) | def get_devices_count(): method get_model_count (line 506) | def get_model_count(self) -> int: method is_model_vllm_backend (line 509) | async def is_model_vllm_backend(self, model_uid: str) -> bool: method allocate_devices (line 515) | def allocate_devices(self, model_uid: str, n_gpu: int) -> List[int]: method allocate_devices_with_gpu_idx (line 560) | async def allocate_devices_with_gpu_idx( method get_gpu_allocation_status (line 598) | async def get_gpu_allocation_status(self) -> Dict[str, Any]: method release_devices (line 610) | def release_devices(self, model_uid: str): method _create_subpool (line 628) | async def _create_subpool( method _check_model_is_valid (line 662) | def _check_model_is_valid(self, model_name: str, model_format: Optiona... method register_model (line 670) | async def register_model(self, model_type: str, model: str, persist: b... method unregister_model (line 694) | async def unregister_model(self, model_type: str, model_name: str): method update_model_type (line 703) | async def update_model_type(self, model_type: str): method _store_complete_model_configurations (line 794) | async def _store_complete_model_configurations(self, model_type: str, ... method list_model_registrations (line 833) | async def list_model_registrations( method get_model_registration (line 1154) | async def get_model_registration(self, model_type: str, model_name: st... method query_engines_by_model_name (line 1239) | async def query_engines_by_model_name( method _get_model_ability (line 1255) | async def _get_model_ability(self, model: Any, model_type: str) -> Lis... method update_cache_status (line 1271) | async def update_cache_status(self, model_name: str, version_info: Any): method _create_virtual_env_manager (line 1286) | def _create_virtual_env_manager( method _prepare_virtual_env (line 1373) | def _prepare_virtual_env( method _get_progressor (line 1460) | async def _get_progressor(self, request_id: str): method _upload_download_progress (line 1479) | def _upload_download_progress( method launch_builtin_model (line 1490) | async def launch_builtin_model( method wait_for_load (line 1803) | async def wait_for_load(self, model_uid: str): method cancel_launch_model (line 1808) | async def cancel_launch_model(self, model_uid: str): method terminate_model (line 1841) | async def terminate_model(self, model_uid: str, is_model_die=False): method get_model_launch_status (line 1948) | def get_model_launch_status(self, model_uid: str) -> Optional[str]: method list_models (line 1963) | async def list_models(self) -> Dict[str, Dict[str, Any]]: method get_model (line 1967) | def get_model(self, model_uid: str) -> xo.ActorRefType["ModelActor"]: method describe_model (line 1977) | def describe_model(self, model_uid: str) -> Dict[str, Any]: method report_status (line 1983) | async def report_status(self): method _periodical_report_status (line 1996) | async def _periodical_report_status(self): method list_cached_models (line 2016) | async def list_cached_models( method list_deletable_models (line 2040) | async def list_deletable_models(self, model_version: str) -> List[str]: method confirm_and_remove_model (line 2079) | async def confirm_and_remove_model(self, model_version: str) -> bool: method list_virtual_envs (line 2101) | async def list_virtual_envs( method list_virtual_env_packages (line 2127) | async def list_virtual_env_packages(self, model_name: str) -> Dict[str... method remove_virtual_env (line 2131) | async def remove_virtual_env( method get_workers_info (line 2142) | async def get_workers_info(self) -> Dict[str, Any]: method update_model_status (line 2149) | def update_model_status(self, model_uid: str, **kwargs): method get_model_status (line 2155) | def get_model_status(self, model_uid: str): method record_metrics (line 2159) | def record_metrics(name, op, kwargs): method start_transfer_for_vllm (line 2162) | async def start_transfer_for_vllm( method launch_rank0_model (line 2169) | async def launch_rank0_model( method recover_model (line 2202) | async def recover_model(self, launch_args: Dict[str, Any]): FILE: xinference/deploy/cmdline.py function get_endpoint (line 59) | def get_endpoint(endpoint: Optional[str]) -> str: function get_hash_endpoint (line 71) | def get_hash_endpoint(endpoint: str) -> str: function get_stored_token (line 79) | def get_stored_token( function start_local_cluster (line 95) | def start_local_cluster( function cli (line 158) | def cli( function local (line 218) | def local( function supervisor (line 272) | def supervisor( function worker (line 334) | def worker( function register_model (line 394) | def register_model( function unregister_model (line 437) | def unregister_model( function list_model_registrations (line 475) | def list_model_registrations( function list_cached_models (line 624) | def list_cached_models( function remove_cache (line 680) | def remove_cache( function model_launch (line 893) | def model_launch( function model_list (line 1074) | def model_list(endpoint: Optional[str], api_key: Optional[str]): function model_terminate (line 1208) | def model_terminate( function model_generate (line 1246) | def model_generate( function model_chat (line 1349) | def model_chat( function vllm_models (line 1452) | def vllm_models(endpoint: Optional[str], api_key: Optional[str]): function cluster_login (line 1475) | def cluster_login( function query_engine_by_model_name (line 1536) | def query_engine_by_model_name( function cal_model_mem (line 1691) | def cal_model_mem( function stop_cluster (line 1752) | def stop_cluster(endpoint: str, api_key: Optional[str], check: bool): FILE: xinference/deploy/local.py function _start_local_cluster (line 42) | async def _start_local_cluster( function run (line 82) | def run( function run_in_subprocess (line 119) | def run_in_subprocess( function main (line 149) | def main( FILE: xinference/deploy/supervisor.py function _start_supervisor (line 35) | async def _start_supervisor(address: str, logging_conf: Optional[Dict] =... function run (line 52) | def run(address: str, logging_conf: Optional[Dict] = None): function run_in_subprocess (line 65) | def run_in_subprocess( function main (line 73) | def main( FILE: xinference/deploy/test/test_cmdline.py function test_cmdline (line 37) | def test_cmdline(setup, stream, model_uid): function test_cmdline_model_path_error (line 150) | def test_cmdline_model_path_error(setup): function test_cmdline_of_custom_model (line 182) | def test_cmdline_of_custom_model(setup): function test_rotate_logs (line 275) | def test_rotate_logs(setup_with_file_logging): function test_list_cached_models (line 314) | def test_list_cached_models(setup): function test_remove_cache (line 331) | def test_remove_cache(setup): function test_launch_error_in_passing_parameters (line 345) | def test_launch_error_in_passing_parameters(): FILE: xinference/deploy/utils.py class LoggerNameFilter (line 34) | class LoggerNameFilter(logging.Filter): method filter (line 35) | def filter(self, record): function get_log_file (line 42) | def get_log_file(sub_dir: str): function get_config_dict (line 55) | def get_config_dict( function create_worker_actor_pool (line 141) | async def create_worker_actor_pool( function health_check (line 152) | def health_check(address: str, max_attempts: int, sleep_interval: int = ... function get_timestamp_ms (line 190) | def get_timestamp_ms(): function handle_click_args_type (line 196) | def handle_click_args_type(arg: str) -> Any: function set_envs (line 218) | def set_envs(key: str, value: str): FILE: xinference/deploy/worker.py function start_worker_components (line 30) | async def start_worker_components( function _start_worker (line 58) | async def _start_worker( function main (line 78) | def main( FILE: xinference/device_utils.py function is_vacc_available (line 29) | def is_vacc_available() -> bool: function is_xpu_available (line 39) | def is_xpu_available() -> bool: function is_npu_available (line 43) | def is_npu_available() -> bool: function is_mlu_available (line 53) | def is_mlu_available() -> bool: function is_musa_available (line 63) | def is_musa_available() -> bool: function get_available_device (line 74) | def get_available_device() -> DeviceType: function is_device_available (line 92) | def is_device_available(device: str) -> bool: function move_model_to_available_device (line 113) | def move_model_to_available_device(model): function get_device_preferred_dtype (line 122) | def get_device_preferred_dtype(device: str) -> Union[torch.dtype, None]: function is_hf_accelerate_supported (line 140) | def is_hf_accelerate_supported(device: str) -> bool: function empty_cache (line 150) | def empty_cache(): function get_available_device_env_name (line 177) | def get_available_device_env_name(): function gpu_count (line 181) | def gpu_count(): function _get_nvidia_gpu_mem_info (line 199) | def _get_nvidia_gpu_mem_info(gpu_id: int) -> Dict[str, float]: function get_nvidia_gpu_info (line 220) | def get_nvidia_gpu_info() -> Dict: FILE: xinference/isolation.py class Isolation (line 20) | class Isolation: method __init__ (line 22) | def __init__( method _run (line 36) | def _run(self): method _cancel_all_tasks (line 43) | def _cancel_all_tasks(loop): method start (line 65) | def start(self): method call (line 73) | def call(self, coro: Coroutine) -> Any: method thread_ident (line 78) | def thread_ident(self): method loop (line 82) | def loop(self): method _stop (line 85) | async def _stop(self): method stop (line 88) | def stop(self): FILE: xinference/model/__init__.py function _install (line 16) | def _install(): FILE: xinference/model/audio/__init__.py function register_custom_model (line 41) | def register_custom_model(): function _need_filter (line 63) | def _need_filter(spec: dict): function _install (line 71) | def _install(): function register_builtin_model (line 97) | def register_builtin_model(): function has_downloaded_models (line 102) | def has_downloaded_models(): function load_downloaded_models (line 109) | def load_downloaded_models(): function load_model_family_from_json (line 124) | def load_model_family_from_json(json_filename, target_families): FILE: xinference/model/audio/chattts.py class ChatTTSModel (line 28) | class ChatTTSModel: method __init__ (line 29) | def __init__( method model_ability (line 46) | def model_ability(self): method load (line 49) | def load(self): method speech (line 64) | def speech( FILE: xinference/model/audio/core.py function get_audio_model_descriptions (line 42) | def get_audio_model_descriptions(): class AudioModelFamilyV2 (line 48) | class AudioModelFamilyV2(CacheableModelSpec, ModelInstanceInfoMixin): class Config (line 62) | class Config: method to_description (line 65) | def to_description(self): method to_version_info (line 76) | def to_version_info(self): function generate_audio_description (line 88) | def generate_audio_description( function match_audio (line 96) | def match_audio( function create_audio_model_instance (line 136) | def create_audio_model_instance( FILE: xinference/model/audio/cosyvoice.py class CosyVoiceModel (line 26) | class CosyVoiceModel: method __init__ (line 27) | def __init__( method model_ability (line 45) | def model_ability(self): method load (line 48) | def load(self): method _speech_handle (line 80) | def _speech_handle( method speech (line 154) | def speech( FILE: xinference/model/audio/custom.py class CustomAudioModelFamilyV2 (line 32) | class CustomAudioModelFamilyV2(AudioModelFamilyV2): method parse_raw (line 39) | def parse_raw( class AudioModelRegistry (line 75) | class AudioModelRegistry(ModelRegistry): method __init__ (line 78) | def __init__(self): function get_user_defined_audios (line 86) | def get_user_defined_audios() -> List[CustomAudioModelFamilyV2]: function register_audio (line 93) | def register_audio(model_spec: CustomAudioModelFamilyV2, persist: bool): function unregister_audio (line 100) | def unregister_audio(model_name: str, raise_error: bool = True): FILE: xinference/model/audio/f5tts.py class F5TTSModel (line 27) | class F5TTSModel: method __init__ (line 28) | def __init__( method model_ability (line 46) | def model_ability(self): method load (line 49) | def load(self): method _infer (line 92) | def _infer(self, ref_audio, ref_text, text_gen, model_obj, mel_spec_ty... method speech (line 152) | def speech( FILE: xinference/model/audio/f5tts_mlx.py class F5TTSMLXModel (line 32) | class F5TTSMLXModel: method __init__ (line 33) | def __init__( method model_ability (line 51) | def model_ability(self): method load (line 54) | def load(self): method speech (line 127) | def speech( FILE: xinference/model/audio/fish_speech.py function wav_chunk_header (line 31) | def wav_chunk_header(sample_rate=44100, bit_depth=16, channels=1): class FishSpeechModel (line 46) | class FishSpeechModel: method __init__ (line 47) | def __init__( method model_ability (line 66) | def model_ability(self): method load (line 69) | def load(self): method speech (line 115) | def speech( FILE: xinference/model/audio/funasr.py class FunASRModel (line 27) | class FunASRModel: method __init__ (line 28) | def __init__( method model_ability (line 45) | def model_ability(self): method convert_to_openai_format (line 48) | def convert_to_openai_format(self, input_data): method load (line 86) | def load(self): method transcriptions (line 113) | def transcriptions( method translations (line 164) | def translations( FILE: xinference/model/audio/indextts2.py class Indextts2 (line 27) | class Indextts2: method __init__ (line 28) | def __init__( method model_ability (line 45) | def model_ability(self): method load (line 48) | def load(self): method speech (line 80) | def speech( FILE: xinference/model/audio/kokoro.py class KokoroModel (line 28) | class KokoroModel: method __init__ (line 29) | def __init__( method model_ability (line 46) | def model_ability(self): method load (line 49) | def load(self): method speech (line 88) | def speech( FILE: xinference/model/audio/kokoro_mlx.py class KokoroMLXModel (line 28) | class KokoroMLXModel: method __init__ (line 29) | def __init__( method model_ability (line 46) | def model_ability(self): method load (line 49) | def load(self): method speech (line 68) | def speech( FILE: xinference/model/audio/kokoro_zh.py class KokoroZHModel (line 30) | class KokoroZHModel: method __init__ (line 31) | def __init__( method _en_callable (line 48) | def _en_callable(self, text): method model_ability (line 60) | def model_ability(self): method load (line 63) | def load(self): method speech (line 89) | def speech( FILE: xinference/model/audio/megatts.py class MegaTTSModel (line 25) | class MegaTTSModel: method __init__ (line 26) | def __init__( method model_ability (line 44) | def model_ability(self): method load (line 47) | def load(self): method speech (line 62) | def speech( FILE: xinference/model/audio/melotts.py class MeloTTSModel (line 26) | class MeloTTSModel: method __init__ (line 27) | def __init__( method model_ability (line 44) | def model_ability(self): method load (line 47) | def load(self): method speech (line 76) | def speech( FILE: xinference/model/audio/qwen3_asr.py class Qwen3ASRModel (line 31) | class Qwen3ASRModel: method __init__ (line 32) | def __init__( method model_ability (line 49) | def model_ability(self): method load (line 52) | def load(self): method _extract_text_and_language (line 87) | def _extract_text_and_language(self, result) -> Tuple[str, Optional[st... method transcriptions (line 105) | def transcriptions( method translations (line 145) | def translations( FILE: xinference/model/audio/tests/test_chattts.py function test_chattts (line 21) | def test_chattts(setup): FILE: xinference/model/audio/tests/test_cosyvoice.py function test_cosyvoice_sft (line 23) | def test_cosyvoice_sft(setup, model_name): function test_cosyvoice (line 76) | def test_cosyvoice(setup, model_name): function test_cosyvoice_instruct (line 127) | def test_cosyvoice_instruct(setup, model_name): FILE: xinference/model/audio/tests/test_f5tts.py function test_f5tts (line 19) | def test_f5tts(setup): FILE: xinference/model/audio/tests/test_f5tts_mlx.py function test_f5tts_mlx (line 19) | def test_f5tts_mlx(setup): FILE: xinference/model/audio/tests/test_fish_speech.py function test_fish_speech (line 19) | def test_fish_speech(setup): FILE: xinference/model/audio/tests/test_funasr.py function test_restful_api_for_funasr (line 20) | def test_restful_api_for_funasr(setup): function test_verbose_for_funasr (line 55) | def test_verbose_for_funasr(setup): FILE: xinference/model/audio/tests/test_kokoro.py function test_kokoro (line 19) | def test_kokoro(setup): function test_kokoro_zh (line 55) | def test_kokoro_zh(setup): FILE: xinference/model/audio/tests/test_megatts.py function test_megatts (line 18) | def test_megatts(setup): FILE: xinference/model/audio/tests/test_melotts.py function test_melotts (line 19) | def test_melotts(setup): FILE: xinference/model/audio/tests/test_whisper.py function test_restful_api_for_whisper (line 22) | def test_restful_api_for_whisper(setup): function test_transcriptions_for_whisper (line 82) | def test_transcriptions_for_whisper(setup): function test_register_custom_audio (line 141) | def test_register_custom_audio(): function test_persistent_custom_audio (line 181) | def test_persistent_custom_audio(): FILE: xinference/model/audio/tests/test_whisper_mlx.py function test_restful_api_for_whisper (line 26) | def test_restful_api_for_whisper(setup): function test_transcriptions_for_whisper (line 80) | def test_transcriptions_for_whisper(setup): FILE: xinference/model/audio/utils.py function _extract_pcm_from_wav_bytes (line 28) | def _extract_pcm_from_wav_bytes(wav_bytes): function ensure_sample_rate (line 35) | def ensure_sample_rate( function audio_stream_generator (line 62) | def audio_stream_generator( function audio_to_bytes (line 108) | def audio_to_bytes(response_format: str, sample_rate: int, tensor: "torc... FILE: xinference/model/audio/whisper.py class WhisperModelConfig (line 34) | class WhisperModelConfig(TypedDict, total=False): class WhisperModel (line 41) | class WhisperModel: method __init__ (line 42) | def __init__( method _sanitize_model_config (line 62) | def _sanitize_model_config( method model_ability (line 74) | def model_ability(self): method load (line 77) | def load(self): method _call_model (line 112) | def _call_model( method transcriptions (line 201) | def transcriptions( method translations (line 226) | def translations( FILE: xinference/model/audio/whisper_mlx.py class WhisperMLXModel (line 26) | class WhisperMLXModel: method __init__ (line 27) | def __init__( method model_ability (line 45) | def model_ability(self): method load (line 48) | def load(self): method transcriptions (line 93) | def transcriptions( method translations (line 112) | def translations( method _call (line 135) | def _call( FILE: xinference/model/batch.py class BatchMixin (line 27) | class BatchMixin: method __init__ (line 32) | def __init__(self, func: _ExtensibleWrapper, **kwargs): method queue (line 48) | def queue(self): method _ensure_process_batch_running (line 53) | def _ensure_process_batch_running(self): method _get_batch_size (line 61) | def _get_batch_size(self, *args, **kwargs) -> int: method _process_batch (line 64) | async def _process_batch(self): method _wrap_method (line 107) | def _wrap_method(self): FILE: xinference/model/cache_manager.py class CacheManager (line 12) | class CacheManager: method __init__ (line 15) | def __init__(self, model_family: "CacheableModelSpec"): method get_cache_dir (line 29) | def get_cache_dir(self): method get_cache_status (line 32) | def get_cache_status(self): method _cache_from_uri (line 36) | def _cache_from_uri(self, model_spec: "CacheableModelSpec") -> str: method _cache (line 60) | def _cache(self) -> str: method cache (line 117) | def cache(self) -> str: method register_custom_model (line 120) | def register_custom_model(self, model_type: str): method unregister_custom_model (line 130) | def unregister_custom_model(self, model_type: str): FILE: xinference/model/core.py function create_model_instance (line 20) | def create_model_instance( class CacheableModelSpec (line 126) | class CacheableModelSpec(BaseModel): class VirtualEnvSettings (line 134) | class VirtualEnvSettings(BaseModel): FILE: xinference/model/custom.py class ModelRegistry (line 29) | class ModelRegistry: method __init__ (line 32) | def __init__(self) -> None: method find_model (line 37) | def find_model(self, model_name: str): method get_custom_models (line 45) | def get_custom_models(self): method check_model_uri (line 49) | def check_model_uri(self, model_spec: "CacheableModelSpec"): method add_ud_model (line 56) | def add_ud_model(self, model_spec): method register (line 59) | def register(self, model_spec: "CacheableModelSpec", persist: bool): method remove_ud_model (line 83) | def remove_ud_model(self, model_spec): method remove_ud_model_files (line 86) | def remove_ud_model_files(self, model_spec): method unregister (line 92) | def unregister( class RegistryManager (line 110) | class RegistryManager: method get_registry (line 114) | def get_registry(cls, model_type: str) -> ModelRegistry: function migrate_from_v1_to_v2 (line 140) | def migrate_from_v1_to_v2(model_type: str, model_spec_cls: Type): FILE: xinference/model/embedding/__init__.py function register_builtin_model (line 45) | def register_builtin_model(): function register_custom_model (line 50) | def register_custom_model(): function check_format_with_engine (line 72) | def check_format_with_engine(model_format, engine): function generate_engine_config_by_model_name (line 80) | def generate_engine_config_by_model_name(model_family: "EmbeddingModelFa... function has_downloaded_models (line 118) | def has_downloaded_models(): function load_downloaded_models (line 127) | def load_downloaded_models(): function load_model_family_from_json (line 144) | def load_model_family_from_json(json_filename, target_families): function load_downloaded_models_to_dict (line 168) | def load_downloaded_models_to_dict(target_dict): function _install (line 184) | def _install(): FILE: xinference/model/embedding/cache_manager.py class EmbeddingCacheManager (line 10) | class EmbeddingCacheManager(CacheManager): method __init__ (line 11) | def __init__(self, model_family: "EmbeddingModelFamilyV2"): method cache (line 25) | def cache(self) -> str: FILE: xinference/model/embedding/core.py function get_embedding_model_descriptions (line 49) | def get_embedding_model_descriptions(): class TransformersEmbeddingSpecV1 (line 55) | class TransformersEmbeddingSpecV1(BaseModel): class LlamaCppEmbeddingSpecV1 (line 64) | class LlamaCppEmbeddingSpecV1(BaseModel): class EmbeddingModelFamilyV2 (line 83) | class EmbeddingModelFamilyV2(BaseModel, ModelInstanceInfoMixin): class Config (line 93) | class Config: method to_description (line 96) | def to_description(self): method to_version_info (line 111) | def to_version_info(self): function get_model_version (line 125) | def get_model_version(embedding_model: EmbeddingModelFamilyV2) -> str: function generate_embedding_description (line 130) | def generate_embedding_description( class EmbeddingModel (line 142) | class EmbeddingModel(abc.ABC): method __init__ (line 143) | def __init__( method check_lib (line 166) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 171) | def match_json( method match (line 180) | def match( method load (line 196) | def load(self): method _fix_langchain_openai_inputs (line 201) | def _fix_langchain_openai_inputs( method _text_length (line 239) | def _text_length(text): method _create_embedding (line 250) | def _create_embedding( method create_embedding (line 271) | def create_embedding( method create_embedding (line 279) | def create_embedding(self, args_list, kwargs_list): method _extract_sentences_kwargs (line 329) | def _extract_sentences_kwargs(self, args, kwargs): method _get_batch_size (line 363) | def _get_batch_size(self, *args, **kwargs) -> int: method convert_ids_to_tokens (line 370) | def convert_ids_to_tokens( method _clean_cache_if_needed (line 400) | def _clean_cache_if_needed(self, all_token_nums: int): function create_embedding_model_instance (line 416) | def create_embedding_model_instance( FILE: xinference/model/embedding/custom.py class CustomEmbeddingModelFamilyV2 (line 25) | class CustomEmbeddingModelFamilyV2(EmbeddingModelFamilyV2): class EmbeddingModelRegistry (line 32) | class EmbeddingModelRegistry(ModelRegistry): method __init__ (line 35) | def __init__(self): method add_ud_model (line 42) | def add_ud_model(self, model_spec): method check_model_uri (line 48) | def check_model_uri(self, model_family: "EmbeddingModelFamilyV2"): method remove_ud_model (line 56) | def remove_ud_model(self, model_family: "CustomEmbeddingModelFamilyV2"): method remove_ud_model_files (line 62) | def remove_ud_model_files(self, model_family: "CustomEmbeddingModelFam... function get_user_defined_embeddings (line 72) | def get_user_defined_embeddings() -> List[EmbeddingModelFamilyV2]: function register_embedding (line 79) | def register_embedding(model_family: CustomEmbeddingModelFamilyV2, persi... function unregister_embedding (line 86) | def unregister_embedding(model_name: str, raise_error: bool = True): FILE: xinference/model/embedding/embed_family.py function match_embedding (line 31) | def match_embedding( function check_engine_by_model_name_and_engine (line 118) | def check_engine_by_model_name_and_engine( function check_engine_by_model_name_and_engine_with_virtual_env (line 147) | def check_engine_by_model_name_and_engine_with_virtual_env( FILE: xinference/model/embedding/flag/core.py class FlagEmbeddingModel (line 40) | class FlagEmbeddingModel(EmbeddingModel, BatchMixin): method __init__ (line 41) | def __init__( method load (line 57) | def load(self): method _create_embedding (line 105) | def _create_embedding( method check_lib (line 285) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 292) | def match_json( FILE: xinference/model/embedding/flag/tests/test_flag.py function test_embedding_model_with_flag (line 42) | async def test_embedding_model_with_flag(): FILE: xinference/model/embedding/llama_cpp/core.py class _Done (line 34) | class _Done: class _Error (line 38) | class _Error: method __init__ (line 39) | def __init__(self, msg): class XllamaCppEmbeddingModel (line 43) | class XllamaCppEmbeddingModel(EmbeddingModel, BatchMixin): method __init__ (line 44) | def __init__(self, *args, **kwargs) -> None: method _sanitize_model_config (line 52) | def _sanitize_model_config(self, llamacpp_model_config: Optional[dict]... method _is_darwin_and_apple_silicon (line 67) | def _is_darwin_and_apple_silicon(self): method _is_linux (line 70) | def _is_linux(self): method load (line 73) | def load(self): method _create_embedding (line 197) | def _create_embedding( method check_lib (line 232) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 239) | def match_json( FILE: xinference/model/embedding/llama_cpp/tests/test_llama_cpp.py function test_embedding_model_with_xllamacpp (line 42) | async def test_embedding_model_with_xllamacpp(): FILE: xinference/model/embedding/sentence_transformers/core.py class SentenceTransformerEmbeddingModel (line 32) | class SentenceTransformerEmbeddingModel(EmbeddingModel, BatchMixin): method __init__ (line 33) | def __init__(self, *args, **kwargs) -> None: method load (line 38) | def load(self): method _create_embedding (line 158) | def _create_embedding( method _normalize_vl_inputs (line 455) | def _normalize_vl_inputs( method _create_qwen3_vl_embedding (line 471) | def _create_qwen3_vl_embedding(self, sentences, **kwargs): method check_lib (line 503) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 507) | def match_json( FILE: xinference/model/embedding/sentence_transformers/tests/test_sentence_transformers.py function test_embedding_model_with_sentence_transformer (line 42) | async def test_embedding_model_with_sentence_transformer(): function test_embedding_model_with_sentence_transformer_truncate_dim (line 81) | async def test_embedding_model_with_sentence_transformer_truncate_dim(): FILE: xinference/model/embedding/tests/test_embedding_models.py function test_engine_supported (line 76) | def test_engine_supported(): function test_model_from_modelscope (line 83) | async def test_model_from_modelscope(): function test_get_cache_status (line 103) | def test_get_cache_status(): function test_from_local_uri (line 115) | def test_from_local_uri(): function test_register_custom_embedding (line 143) | def test_register_custom_embedding(): function test_register_fault_embedding (line 224) | def test_register_fault_embedding(): function test_convert_ids_to_tokens (line 304) | def test_convert_ids_to_tokens(): FILE: xinference/model/embedding/tests/test_integrated_embedding.py function test_sparse_embedding (line 25) | def test_sparse_embedding(setup): function test_clip_embedding (line 48) | def test_clip_embedding(setup): function test_llama_cpp_embedding (line 83) | def test_llama_cpp_embedding(setup): FILE: xinference/model/embedding/tests/test_qwen3_vl_engine_params.py function _assert_engine_params (line 35) | def _assert_engine_params(params, engine_name): function test_qwen3_vl_embedding_engine_params_with_virtualenv (line 44) | def test_qwen3_vl_embedding_engine_params_with_virtualenv(): function _get_cached_model_path (line 54) | def _get_cached_model_path(): function _get_virtualenv_site_packages (line 60) | def _get_virtualenv_site_packages(env_path: str) -> str: function _purge_modules (line 67) | def _purge_modules(prefixes): function _prepare_engine_virtualenv (line 73) | def _prepare_engine_virtualenv(engine_name: str, virtual_env_packages=No... function test_qwen3_vl_embedding_sentence_transformers_startup_virtualenv (line 120) | def test_qwen3_vl_embedding_sentence_transformers_startup_virtualenv(): FILE: xinference/model/embedding/vllm/core.py class VLLMEmbeddingModel (line 30) | class VLLMEmbeddingModel(EmbeddingModel, BatchMixin): method __init__ (line 31) | def __init__(self, *args, **kwargs): method load (line 36) | def load(self): method _get_detailed_instruct (line 85) | def _get_detailed_instruct(task_description: str, query: str) -> str: method _create_embedding (line 88) | def _create_embedding( method _embed_vl (line 172) | def _embed_vl( method check_lib (line 229) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 236) | def match_json( method wait_for_load (line 262) | def wait_for_load(self): method _set_context_length (line 266) | def _set_context_length(self): FILE: xinference/model/embedding/vllm/tests/test_vllm_embedding.py function test_embedding_model_with_vllm (line 46) | async def test_embedding_model_with_vllm(): function test_embedding_model_with_vllm_long_text (line 86) | async def test_embedding_model_with_vllm_long_text(): function test_change_dim (line 161) | def test_change_dim(setup): FILE: xinference/model/flexible/__init__.py function register_custom_model (line 37) | def register_custom_model(): function _install (line 54) | def _install(): FILE: xinference/model/flexible/core.py class FlexibleModelSpec (line 28) | class FlexibleModelSpec(CacheableModelSpec, ModelInstanceInfoMixin): method parser_args (line 37) | def parser_args(self): class Config (line 40) | class Config: method to_description (line 43) | def to_description(self): method to_version_info (line 53) | def to_version_info(self): function generate_flexible_model_description (line 63) | def generate_flexible_model_description( function get_flexible_model_descriptions (line 75) | def get_flexible_model_descriptions(): class FlexibleModel (line 81) | class FlexibleModel: method __init__ (line 82) | def __init__( method load (line 96) | def load(self): method infer (line 101) | def infer(self, *args, **kwargs): method model_uid (line 108) | def model_uid(self): method model_path (line 112) | def model_path(self): method device (line 116) | def device(self): method config (line 120) | def config(self): function match_flexible_model (line 124) | def match_flexible_model(model_name): function create_flexible_model_instance (line 133) | def create_flexible_model_instance( FILE: xinference/model/flexible/custom.py class FlexibleModelRegistry (line 9) | class FlexibleModelRegistry(ModelRegistry): method __init__ (line 12) | def __init__(self): method register (line 19) | def register(self, model_spec: "FlexibleModelSpec", persist: bool): function get_flexible_models (line 51) | def get_flexible_models(): function register_flexible_model (line 58) | def register_flexible_model(model_spec: "FlexibleModelSpec", persist: bo... function unregister_flexible_model (line 65) | def unregister_flexible_model(model_name: str, raise_error: bool = True): FILE: xinference/model/flexible/launchers/image_process_launcher.py class ImageRemoveBackgroundModel (line 25) | class ImageRemoveBackgroundModel(FlexibleModel): method infer (line 26) | def infer(self, *args, **kwargs): function launcher (line 58) | def launcher(model_uid: str, model_spec: FlexibleModelSpec, **kwargs) ->... FILE: xinference/model/flexible/launchers/modelscope_launcher.py class ModelScopePipelineModel (line 18) | class ModelScopePipelineModel(FlexibleModel): method load (line 19) | def load(self): method infer (line 32) | def infer(self, *args, **kwargs): function launcher (line 36) | def launcher(model_uid: str, model_spec: FlexibleModelSpec, **kwargs) ->... FILE: xinference/model/flexible/launchers/transformers_launcher.py class MockModel (line 20) | class MockModel(FlexibleModel): method infer (line 21) | def infer(self, *args, **kwargs): class AutoModel (line 25) | class AutoModel(FlexibleModel): method load (line 26) | def load(self): method infer (line 30) | def infer(self, *args, **kwargs): class TransformersTextClassificationModel (line 34) | class TransformersTextClassificationModel(FlexibleModel): method load (line 35) | def load(self): method infer (line 40) | def infer(self, *args, **kwargs): function launcher (line 44) | def launcher(model_uid: str, model_spec: FlexibleModelSpec, **kwargs) ->... FILE: xinference/model/flexible/launchers/yolo_launcher.py class UltralyticsModel (line 25) | class UltralyticsModel(FlexibleModel): method load (line 26) | def load(self): method infer (line 35) | def infer(self, *args, **kwargs): function launcher (line 53) | def launcher(model_uid: str, model_spec: FlexibleModelSpec, **kwargs) ->... FILE: xinference/model/flexible/tests/test_flexible_models.py function test_register_flexible_model (line 20) | def test_register_flexible_model(): function test_model (line 39) | def test_model(): FILE: xinference/model/flexible/utils.py function get_launcher (line 18) | def get_launcher(launcher_name: str): FILE: xinference/model/image/__init__.py function register_custom_model (line 43) | def register_custom_model(): function _install (line 65) | def _install(): function register_builtin_model (line 102) | def register_builtin_model(): function has_downloaded_models (line 107) | def has_downloaded_models(): function load_downloaded_models (line 114) | def load_downloaded_models(): function load_model_family_from_json (line 129) | def load_model_family_from_json(json_filename, target_families): FILE: xinference/model/image/cache_manager.py class ImageCacheManager (line 7) | class ImageCacheManager(CacheManager): method __init__ (line 8) | def __init__(self, model_family): method cache_gguf (line 24) | def cache_gguf(self, quantization: Optional[str] = None): method cache_lightning (line 80) | def cache_lightning(self, lightning_version: Optional[str] = None): FILE: xinference/model/image/core.py function get_image_model_descriptions (line 32) | def get_image_model_descriptions(): class ImageModelFamilyV2 (line 38) | class ImageModelFamilyV2(CacheableModelSpec, ModelInstanceInfoMixin): class Config (line 58) | class Config: method to_description (line 61) | def to_description(self): method to_version_info (line 77) | def to_version_info(self): function generate_image_description (line 106) | def generate_image_description( function match_diffusion (line 114) | def match_diffusion( function create_ocr_model_instance (line 155) | def create_ocr_model_instance( function create_image_model_instance (line 206) | def create_image_model_instance( function _select_ocr_model_family (line 341) | def _select_ocr_model_family( FILE: xinference/model/image/custom.py class CustomImageModelFamilyV2 (line 24) | class CustomImageModelFamilyV2(ImageModelFamilyV2): class ImageModelRegistry (line 35) | class ImageModelRegistry(ModelRegistry): method __init__ (line 38) | def __init__(self): function get_user_defined_images (line 46) | def get_user_defined_images() -> List[ImageModelFamilyV2]: function register_image (line 53) | def register_image(model_spec: CustomImageModelFamilyV2, persist: bool): function unregister_image (line 68) | def unregister_image(model_name: str, raise_error: bool = True): FILE: xinference/model/image/engine.py class DiffusersImageModel (line 24) | class DiffusersImageModel(DiffusionModel, ImageEngineModel): method match (line 30) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: class VLLMImageModel (line 34) | class VLLMImageModel(ImageEngineModel): method match (line 36) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method check_lib (line 41) | def check_lib(cls): class SGLangImageModel (line 48) | class SGLangImageModel(ImageEngineModel): method match (line 50) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method check_lib (line 55) | def check_lib(cls): function register_builtin_image_engines (line 62) | def register_builtin_image_engines() -> None: FILE: xinference/model/image/engine_family.py class ImageEngineModel (line 25) | class ImageEngineModel: method __init__ (line 28) | def __init__(self, *args: Any, **kwargs: Any) -> None: method match (line 32) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method check_lib (line 36) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: function check_engine_by_model_name_and_engine (line 48) | def check_engine_by_model_name_and_engine( function check_engine_by_model_name_and_engine_with_virtual_env (line 81) | def check_engine_by_model_name_and_engine_with_virtual_env( function generate_engine_config_by_model_name (line 134) | def generate_engine_config_by_model_name(model_family: "ImageModelFamily... FILE: xinference/model/image/ocr/__init__.py function register_builtin_ocr_engines (line 36) | def register_builtin_ocr_engines() -> None: FILE: xinference/model/image/ocr/deepseek_ocr.py class DeepSeekOCRModelSize (line 35) | class DeepSeekOCRModelSize: method __init__ (line 44) | def __init__(self, size_type: str): method from_string (line 64) | def from_string(cls, size_str: str) -> "DeepSeekOCRModelSize": method __str__ (line 68) | def __str__(self) -> str: function load_image (line 72) | def load_image(image_path: str) -> Optional[PIL.Image.Image]: function find_closest_aspect_ratio (line 87) | def find_closest_aspect_ratio( function dynamic_preprocess (line 112) | def dynamic_preprocess( function normalize_transform (line 166) | def normalize_transform( class BasicImageTransform (line 183) | class BasicImageTransform: method __init__ (line 186) | def __init__( method __call__ (line 206) | def __call__(self, x: PIL.Image.Image) -> torch.Tensor: function re_match (line 210) | def re_match(text: str) -> Tuple[List[Tuple], List[str], List[str]]: function extract_coordinates_and_label (line 225) | def extract_coordinates_and_label( function draw_bounding_boxes (line 239) | def draw_bounding_boxes( function process_image_with_refs (line 339) | def process_image_with_refs( function clean_ocr_annotations (line 347) | def clean_ocr_annotations(text: str) -> str: function extract_text_blocks (line 374) | def extract_text_blocks(text: str) -> List[Dict[str, Any]]: class DeepSeekOCRModel (line 416) | class DeepSeekOCRModel(OCRModel): method match (line 420) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method __init__ (line 424) | def __init__( method model_ability (line 445) | def model_ability(self): method load (line 448) | def load(self): method ocr (line 487) | def ocr( method visualize_ocr (line 583) | def visualize_ocr( method _visualize_single (line 653) | def _visualize_single( method _ocr_single (line 795) | def _ocr_single( method infer (line 940) | def infer( FILE: xinference/model/image/ocr/got_ocr2.py class GotOCR2Model (line 28) | class GotOCR2Model(OCRModel): method match (line 32) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method __init__ (line 35) | def __init__( method model_ability (line 56) | def model_ability(self): method load (line 59) | def load(self): method ocr (line 75) | def ocr( FILE: xinference/model/image/ocr/hunyuan_ocr.py class HunyuanOCRModel (line 29) | class HunyuanOCRModel(OCRModel): method match (line 33) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method __init__ (line 36) | def __init__( method model_ability (line 54) | def model_ability(self): method _load (line 57) | def _load(self): method load (line 82) | def load(self): method ocr (line 86) | def ocr(self, image: PIL.Image.Image, prompt: Optional[str] = None, **... FILE: xinference/model/image/ocr/mlx.py class MLXDeepSeekOCRModel (line 30) | class MLXDeepSeekOCRModel(DeepSeekOCRModel): method __init__ (line 33) | def __init__( method match (line 45) | def match(cls, model_family) -> bool: method check_lib (line 50) | def check_lib(cls): method load (line 55) | def load(self): method ocr (line 245) | def ocr( method _ocr_single (line 257) | def _ocr_single( method _prepare_inputs (line 278) | def _prepare_inputs(self, image: PIL.Image.Image, prompt: str): method _generate_text (line 293) | def _generate_text(self, image: PIL.Image.Image, prompt: str, **kwargs... FILE: xinference/model/image/ocr/ocr_family.py class OCRModel (line 25) | class OCRModel: method __init__ (line 28) | def __init__(self, *args: Any, **kwargs: Any) -> None: method match (line 32) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method check_lib (line 36) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: function check_engine_by_model_name_and_engine (line 48) | def check_engine_by_model_name_and_engine( function check_engine_by_model_name_and_engine_with_virtual_env (line 77) | def check_engine_by_model_name_and_engine_with_virtual_env( function generate_engine_config_by_model_name (line 126) | def generate_engine_config_by_model_name(model_family: "ImageModelFamily... FILE: xinference/model/image/ocr/paddleocr_vl.py class PaddleOCRVLModel (line 29) | class PaddleOCRVLModel(OCRModel): method match (line 35) | def match(cls, model_family: "ImageModelFamilyV2") -> bool: method __init__ (line 38) | def __init__( method model_ability (line 59) | def model_ability(self): method load (line 62) | def load(self): method ocr (line 99) | def ocr( method _process_single (line 173) | def _process_single( FILE: xinference/model/image/ocr/vllm.py function _load_vllm_model (line 29) | def _load_vllm_model(model_path: str, model_kwargs: Dict[str, Any]): function _sanitize_vllm_kwargs (line 54) | def _sanitize_vllm_kwargs(kwargs: Dict[str, Any]) -> Dict[str, Any]: function _filter_engine_args (line 69) | def _filter_engine_args(model_kwargs: Dict[str, Any]) -> Dict[str, Any]: function _build_sampling_params (line 82) | def _build_sampling_params(kwargs: Dict[str, Any]): function _extract_text (line 107) | def _extract_text(outputs: List[Any]) -> List[str]: function _shutdown_vllm_model (line 117) | def _shutdown_vllm_model(model: Any) -> None: class VLLMDeepSeekOCRModel (line 146) | class VLLMDeepSeekOCRModel(DeepSeekOCRModel): method load (line 149) | def load(self): method stop (line 154) | def stop(self): method _prepare_inputs (line 159) | def _prepare_inputs( method ocr (line 167) | def ocr( method visualize_ocr (line 200) | def visualize_ocr( class VLLMGotOCR2Model (line 232) | class VLLMGotOCR2Model(GotOCR2Model): class VLLMHunyuanOCRModel (line 236) | class VLLMHunyuanOCRModel(HunyuanOCRModel): method load (line 239) | def load(self): method stop (line 249) | def stop(self): method _build_prompt (line 255) | def _build_prompt(self, image: PIL.Image.Image, prompt: str) -> str: method ocr (line 272) | def ocr( class VLLMPaddleOCRVLModel (line 307) | class VLLMPaddleOCRVLModel(PaddleOCRVLModel): FILE: xinference/model/image/scheduler/flux.py class Text2ImageRequest (line 36) | class Text2ImageRequest: method __init__ (line 37) | def __init__( method _set_width_and_height (line 71) | def _set_width_and_height(self): method set_generate_kwargs (line 74) | def set_generate_kwargs(self, generate_kwargs: Dict): method prompt (line 78) | def prompt(self): method n (line 82) | def n(self): method size (line 86) | def size(self): method response_format (line 90) | def response_format(self): method kwargs (line 94) | def kwargs(self): method width (line 98) | def width(self): method height (line 102) | def height(self): method generate_kwargs (line 106) | def generate_kwargs(self): method request_id (line 110) | def request_id(self): class FluxBatchSchedulerActor (line 114) | class FluxBatchSchedulerActor(xo.StatelessActor): method gen_uid (line 116) | def gen_uid(cls, model_uid: str): method __init__ (line 119) | def __init__(self): method set_model (line 129) | def set_model(self, model): method __post_create__ (line 135) | async def __post_create__(self): method __pre_destroy__ (line 144) | async def __pre_destroy__(self): method add_request (line 154) | async def add_request(self, unique_id: str, future, *args, **kwargs): method abort_request (line 163) | async def abort_request(self, req_id: str) -> str: method _handle_request (line 178) | def _handle_request( method _empty_cache (line 226) | def _empty_cache(): method step (line 231) | async def step(self): method run (line 263) | async def run(self): function _cat_tensors (line 275) | def _cat_tensors(infos: List[Dict]) -> Dict: function _batch_text_to_image_internal (line 286) | def _batch_text_to_image_internal( function _batch_text_to_image (line 511) | def _batch_text_to_image( FILE: xinference/model/image/sdapi.py class SDAPIToDiffusersConverter (line 22) | class SDAPIToDiffusersConverter: method convert_to_diffusers (line 56) | def convert_to_diffusers(sd_type: str, params: dict) -> dict: method get_available_args (line 72) | def get_available_args(sd_type: str) -> set: class SDAPIDiffusionModelMixin (line 78) | class SDAPIDiffusionModelMixin: method _check_kwargs (line 80) | def _check_kwargs(sd_type: str, kwargs: dict): method txt2img (line 106) | def txt2img(self, **kwargs): method _decode_b64_img (line 118) | def _decode_b64_img(img_str: str) -> Image: method img2img (line 127) | def img2img(self, **kwargs): FILE: xinference/model/image/stable_diffusion/core.py function model_accept_param (line 70) | def model_accept_param(params: Union[str, List[str]], model: Any) -> bool: class DiffusionModel (line 87) | class DiffusionModel(SDAPIDiffusionModelMixin): method __init__ (line 88) | def __init__( method model_ability (line 130) | def model_ability(self): method _is_flux2_model (line 133) | def _is_flux2_model(self) -> bool: method _get_pipeline_type (line 140) | def _get_pipeline_type(ability: str) -> type: method _get_controlnet_model (line 151) | def _get_controlnet_model(self, name: str, path: str): method _get_model (line 162) | def _get_model( method _apply_lora (line 221) | def _apply_lora(self): method _get_layer_cls (line 234) | def _get_layer_cls(self, layer: str): method load (line 242) | def load(self): method _should_use_batching (line 378) | def _should_use_batching(self) -> bool: method _get_quantize_config (line 384) | def _get_quantize_config(self, method: str, quantization: str, module:... method _quantize_text_encoder (line 436) | def _quantize_text_encoder(self, quantize_text_encoder: Optional[str]): method _quantize_transformer (line 475) | def _quantize_transformer(self): method _quantize_transformer_gguf (line 511) | def _quantize_transformer_gguf(self): method _process_lightning (line 527) | def _process_lightning(self, kwargs): method _load_to_device (line 564) | def _load_to_device(self, model): method get_max_num_images_for_batching (line 593) | def get_max_num_images_for_batching(self): method _get_scheduler (line 597) | def _get_scheduler(model: Any, sampler_name: str): method _need_set_scheduler (line 681) | def _need_set_scheduler(self, scheduler: Any) -> bool: method _reset_when_done (line 693) | def _reset_when_done(self, model: Any, sampler_name: str): method _release_after (line 708) | def _release_after(): method _wrap_deepcache (line 718) | def _wrap_deepcache(self, model: Any): method _process_progressor (line 730) | def _process_progressor(kwargs: dict): method _call_model (line 749) | def _call_model( method _filter_kwargs (line 794) | def _filter_kwargs(cls, model, kwargs: dict): method text_to_image (line 805) | async def text_to_image( method _ensure_scheduler_started (line 832) | async def _ensure_scheduler_started(self): method _gen_config_for_lightning (line 837) | def _gen_config_for_lightning(self, kwargs): method _direct_text_to_image (line 849) | async def _direct_text_to_image( method abort_request (line 871) | async def abort_request(self, request_id: str) -> str: method pad_to_multiple (line 884) | def pad_to_multiple(image, multiple=8): method _model_expects_four_channel_input (line 892) | def _model_expects_four_channel_input(model: Any) -> bool: method _ensure_four_channel_image (line 898) | def _ensure_four_channel_image(image: Any, model: Any): method _ensure_three_channel_image (line 919) | def _ensure_three_channel_image(image: Any): method image_to_image (line 932) | def image_to_image( method inpainting (line 997) | def inpainting( FILE: xinference/model/image/stable_diffusion/mlx.py function quantization_predicate (line 36) | def quantization_predicate(name: str, m) -> bool: function to_latent_size (line 40) | def to_latent_size(image_size: Tuple[int, int]): class MLXDiffusionModel (line 54) | class MLXDiffusionModel(SDAPIDiffusionModelMixin): method __init__ (line 55) | def __init__( method model_ability (line 81) | def model_ability(self): method support_model (line 85) | def support_model(model_name: str) -> bool: method load (line 88) | def load(self): method _apply_lora (line 118) | def _apply_lora(self): method _release_after (line 136) | def _release_after(): method text_to_image (line 145) | def text_to_image( method image_to_image (line 217) | def image_to_image(self, **kwargs): method inpainting (line 220) | def inpainting(self, **kwargs): FILE: xinference/model/image/tests/test_got_ocr2.py function test_got_ocr2 (line 30) | def test_got_ocr2(setup): FILE: xinference/model/image/tests/test_stable_diffusion.py function test_model (line 48) | async def test_model(): function test_progressor (line 73) | async def test_progressor(): function test_restful_api_for_image_with_canny_controlnet (line 117) | def test_restful_api_for_image_with_canny_controlnet(setup): function test_restful_api_for_image_with_mlsd_controlnet (line 159) | def test_restful_api_for_image_with_mlsd_controlnet(setup): function test_restful_api_abort (line 205) | def test_restful_api_abort(setup, model_name): function test_restful_api_for_sd_turbo (line 263) | def test_restful_api_for_sd_turbo(setup, model_name): function test_restful_api_for_sd_image2image (line 306) | def test_restful_api_for_sd_image2image(setup): function test_restful_api_for_sd_inpainting (line 342) | def test_restful_api_for_sd_inpainting(setup): function test_get_cache_status (line 383) | def test_get_cache_status(): function test_register_custom_image (line 395) | def test_register_custom_image(): function test_persist_custom_image (line 418) | def test_persist_custom_image(): function test_launch_custom_image (line 450) | def test_launch_custom_image(setup): function test_launch_custom_image_with_controlnet (line 511) | def test_launch_custom_image_with_controlnet(setup): FILE: xinference/model/image/utils.py function get_model_version (line 30) | def get_model_version( function _flatten_images (line 40) | def _flatten_images(images): function _needs_png (line 52) | def _needs_png(image) -> bool: function handle_image_result (line 60) | def handle_image_result(response_format: str, images) -> ImageList: FILE: xinference/model/llm/__init__.py function register_builtin_model (line 51) | def register_builtin_model(): function check_format_with_engine (line 56) | def check_format_with_engine(model_format, engine): function generate_engine_config_by_model_family (line 65) | def generate_engine_config_by_model_family(model_family: "LLMFamilyV2"): function register_custom_model (line 122) | def register_custom_model(): function has_downloaded_models (line 142) | def has_downloaded_models(): function load_downloaded_models (line 151) | def load_downloaded_models(): function load_model_family_from_json (line 168) | def load_model_family_from_json(json_filename, target_families): function _install (line 220) | def _install(): FILE: xinference/model/llm/cache_manager.py class LLMCacheManager (line 28) | class LLMCacheManager(CacheManager): method __init__ (line 29) | def __init__( method cache_uri (line 51) | def cache_uri(self) -> str: method cache_from_huggingface (line 75) | def cache_from_huggingface(self) -> str: method cache_from_modelscope (line 148) | def cache_from_modelscope(self) -> str: method cache_from_openmind_hub (line 223) | def cache_from_openmind_hub(self) -> str: method cache_from_csghub (line 252) | def cache_from_csghub(self) -> str: method cache (line 314) | def cache(self) -> str: FILE: xinference/model/llm/config_parser.py function _resolve_config_and_dir (line 8) | def _resolve_config_and_dir(model_path: str) -> Tuple[str, str]: function _load_json_file (line 23) | def _load_json_file(path: str) -> Dict[str, Any]: function _load_tokenizer_config (line 28) | def _load_tokenizer_config(model_dir: str) -> Optional[Dict[str, Any]]: function _load_chat_template_file (line 35) | def _load_chat_template_file(model_dir: str) -> Optional[str]: function _get_first_value (line 44) | def _get_first_value(config: Dict[str, Any], *keys: str) -> Optional[Any]: function _infer_context_length (line 52) | def _infer_context_length(config: Dict[str, Any]) -> int: function _normalize_architectures (line 64) | def _normalize_architectures(config: Dict[str, Any]) -> List[str]: function _match_family_by_architectures (line 73) | def _match_family_by_architectures( function _load_builtin_families (line 90) | def _load_builtin_families() -> List[Dict[str, Any]]: function _infer_languages (line 102) | def _infer_languages(config: Dict[str, Any]) -> List[str]: function _format_size_in_billions (line 111) | def _format_size_in_billions(size_in_billions: float) -> Union[int, str]: function _extract_numeric_size (line 118) | def _extract_numeric_size(value: Any) -> Optional[float]: function _infer_model_size_in_billions (line 143) | def _infer_model_size_in_billions(config: Dict[str, Any]) -> Optional[Un... function _infer_quantization (line 206) | def _infer_quantization(config: Dict[str, Any], model_format: str) -> str: function _extract_chat_template (line 228) | def _extract_chat_template(tokenizer_config: Optional[Dict[str, Any]]) -... function _infer_model_format (line 237) | def _infer_model_format(config: Dict[str, Any]) -> str: function build_llm_registration_from_local_config (line 255) | def build_llm_registration_from_local_config( FILE: xinference/model/llm/core.py function get_llm_version_infos (line 41) | def get_llm_version_infos(): class LLM (line 47) | class LLM(abc.ABC): method __init__ (line 50) | def __init__( method check_lib (line 73) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method _is_darwin_and_apple_silicon (line 77) | def _is_darwin_and_apple_silicon(): method _is_linux (line 81) | def _is_linux(): method _has_cuda_device (line 86) | def _has_cuda_device(): method _has_mlu_device (line 109) | def _has_mlu_device(): method _has_vacc_device (line 126) | def _has_vacc_device(): method _has_musa_device (line 140) | def _has_musa_device(): method _get_cuda_count (line 166) | def _get_cuda_count(): method load (line 184) | def load(self): method match (line 188) | def match( method match_json (line 199) | def match_json( method prepare_parse_reasoning_content (line 204) | def prepare_parse_reasoning_content( method prepare_parse_tool_calls (line 220) | def prepare_parse_tool_calls(self): function generate_llm_version_info (line 240) | def generate_llm_version_info(llm_family: "LLMFamilyV2") -> Dict[str, Li... function create_llm_model_instance (line 259) | def create_llm_model_instance( FILE: xinference/model/llm/custom.py class LLMModelRegistry (line 30) | class LLMModelRegistry(ModelRegistry): method __init__ (line 33) | def __init__(self): method add_ud_model (line 40) | def add_ud_model(self, model_spec): method check_model_uri (line 46) | def check_model_uri(self, llm_family: "LLMFamilyV2"): method remove_ud_model (line 54) | def remove_ud_model(self, llm_family: "LLMFamilyV2"): method remove_ud_model_files (line 60) | def remove_ud_model_files(self, llm_family: "LLMFamilyV2"): function get_user_defined_llm_families (line 70) | def get_user_defined_llm_families(): function register_llm (line 77) | def register_llm(llm_family: "LLMFamilyV2", persist: bool): function unregister_llm (line 84) | def unregister_llm(model_name: str, raise_error: bool = True): FILE: xinference/model/llm/harmony.py class HarmonyStreamParser (line 22) | class HarmonyStreamParser: method __init__ (line 23) | def __init__(self): method feed (line 29) | def feed(self, text): function async_stream_harmony_chat_completion (line 123) | async def async_stream_harmony_chat_completion( FILE: xinference/model/llm/llama_cpp/core.py function _schema_to_grammar (line 33) | def _schema_to_grammar(schema: Dict[str, Any]) -> Optional[str]: function _apply_response_format (line 46) | def _apply_response_format(generate_config: Dict[str, Any]) -> None: class _Done (line 63) | class _Done: class _Error (line 67) | class _Error: method __init__ (line 68) | def __init__(self, msg): class XllamaCppModel (line 72) | class XllamaCppModel(LLM, ChatModelMixin): method __init__ (line 75) | def __init__( method _sanitize_model_config (line 87) | def _sanitize_model_config(self, llamacpp_model_config: Optional[dict]... method check_lib (line 112) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 119) | def match_json( method load (line 131) | def load(self): method generate (line 273) | def generate( method chat (line 331) | def chat( FILE: xinference/model/llm/llama_cpp/tests/test_gguf.py function test_gguf (line 22) | def test_gguf(setup): function surprise_image_base64 (line 42) | def surprise_image_base64(): function test_gguf_multimodal (line 51) | def test_gguf_multimodal(setup, surprise_image_base64): FILE: xinference/model/llm/llama_cpp/tests/test_structured.py class CarType (line 18) | class CarType(str, Enum): class CarDescription (line 25) | class CarDescription(BaseModel): function _load_json_from_message (line 31) | def _load_json_from_message(message: Any) -> Dict[str, Any]: function test_apply_response_format_sets_grammar (line 65) | def test_apply_response_format_sets_grammar(monkeypatch): function test_apply_response_format_handles_conversion_failure (line 89) | def test_apply_response_format_handles_conversion_failure(monkeypatch): function test_apply_response_format_ignores_non_schema (line 116) | def test_apply_response_format_ignores_non_schema(monkeypatch): function test_apply_response_format_uses_real_xllamacpp_if_available (line 123) | def test_apply_response_format_uses_real_xllamacpp_if_available(): function test_llamacpp_qwen3_json_schema (line 151) | def test_llamacpp_qwen3_json_schema(setup): FILE: xinference/model/llm/llm_family.py class LlamaCppLLMSpecV2 (line 52) | class LlamaCppLLMSpecV2(BaseModel): method validate_model_size_with_radix (line 69) | def validate_model_size_with_radix(cls, v: object) -> object: class PytorchLLMSpecV2 (line 80) | class PytorchLLMSpecV2(BaseModel): method validate_model_size_with_radix (line 93) | def validate_model_size_with_radix(cls, v: object) -> object: class MLXLLMSpecV2 (line 104) | class MLXLLMSpecV2(BaseModel): method validate_model_size_with_radix (line 117) | def validate_model_size_with_radix(cls, v: object) -> object: class LLMFamilyV2 (line 128) | class LLMFamilyV2(BaseModel, ModelInstanceInfoMixin): class Config (line 160) | class Config: method _resolve_architectures (line 163) | def _resolve_architectures(self) -> Optional[List[str]]: method has_architecture (line 173) | def has_architecture(self, *architectures: str) -> bool: method matches_supported_architectures (line 179) | def matches_supported_architectures( method to_description (line 187) | def to_description(self): method to_version_info (line 207) | def to_version_info(self): class CustomLLMFamilyV2 (line 235) | class CustomLLMFamilyV2(LLMFamilyV2): method parse_raw (line 237) | def parse_raw( function register_transformer (line 347) | def register_transformer(cls): function cache_model_tokenizer_and_config (line 365) | def cache_model_tokenizer_and_config( function cache_model_config (line 413) | def cache_model_config(llm_family: LLMFamilyV2): function _get_cache_dir_for_model_mem (line 438) | def _get_cache_dir_for_model_mem( function match_model_size (line 462) | def match_model_size( function convert_model_size_to_float (line 481) | def convert_model_size_to_float( function match_llm (line 495) | def match_llm( function check_engine_by_spec_parameters (line 593) | def check_engine_by_spec_parameters( function check_engine_by_spec_parameters_with_virtual_env (line 625) | def check_engine_by_spec_parameters_with_virtual_env( FILE: xinference/model/llm/lmdeploy/core.py class LMDeployModelConfig (line 50) | class LMDeployModelConfig(TypedDict, total=False): class LMDeployGenerateConfig (line 68) | class LMDeployGenerateConfig(TypedDict, total=False): class LMDeployModel (line 84) | class LMDeployModel(LLM): method __init__ (line 87) | def __init__( method _sanitize_model_config (line 102) | def _sanitize_model_config( method load (line 112) | def load(self): method check_lib (line 126) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 133) | def match_json( method generate (line 138) | def generate( class LMDeployChatModel (line 146) | class LMDeployChatModel(LMDeployModel, ChatModelMixin): method load (line 147) | def load(self): method match_json (line 185) | def match_json( method async_chat (line 202) | async def async_chat( method _chat_stream (line 229) | async def _chat_stream(self, messages, include_usage): method _chat (line 279) | async def _chat(self, messages) -> ChatCompletion: method _generate (line 306) | async def _generate( method _get_prompt_input (line 478) | async def _get_prompt_input( FILE: xinference/model/llm/memory.py class ModelLayersInfo (line 43) | class ModelLayersInfo: class ModelMemInfo (line 52) | class ModelMemInfo: function estimate_llm_gpu_memory (line 100) | def estimate_llm_gpu_memory( function estimate_llm_gpu_memory_details (line 130) | def estimate_llm_gpu_memory_details( function _load_item_from_json (line 182) | def _load_item_from_json(config_data: Any, *keys: str) -> str: function load_model_config_json (line 191) | def load_model_config_json(config_path: str) -> ModelLayersInfo: function get_model_layers_info (line 213) | def get_model_layers_info( function _get_default_layers_from_size (line 238) | def _get_default_layers_from_size(size_in_billion: float) -> ModelLayers... function _convert_to_mb_model_size (line 275) | def _convert_to_mb_model_size(model_size: float, quantization: Optional[... function _compute_inference_only_activation_memory (line 289) | def _compute_inference_only_activation_memory( function _compute_model_size_gguf (line 302) | def _compute_model_size_gguf(info: ModelLayersInfo, quantization: str) -... FILE: xinference/model/llm/mlx/core.py class MLXBatchModel (line 64) | class MLXBatchModel: method __init__ (line 78) | def __init__( method _get_lock (line 92) | def _get_lock() -> asyncio.Lock: method _get_or_create_generator (line 98) | def _get_or_create_generator(self, temperature: float, top_p: float): method _ensure_background_worker (line 132) | def _ensure_background_worker(self, gen_dict): method _background_worker (line 138) | async def _background_worker(self, gen_dict): method generate_stream (line 188) | async def generate_stream( method generate (line 332) | async def generate( class MLXModelConfig (line 357) | class MLXModelConfig(TypedDict, total=False): class MLXGenerateConfig (line 371) | class MLXGenerateConfig(TypedDict, total=False): class PromptCache (line 387) | class PromptCache: function get_context_length (line 393) | def get_context_length(config: dict) -> int: class MLXModel (line 410) | class MLXModel(LLM): method __init__ (line 414) | def __init__( method set_loop (line 444) | def set_loop(self, loop: asyncio.AbstractEventLoop): method _cleanup_memory (line 449) | def _cleanup_memory(self): method driver_info (line 460) | def driver_info(self) -> Optional[dict]: method set_shard_info (line 463) | def set_shard_info(self, shard: int, address: str): method get_rank_addresses (line 471) | async def get_rank_addresses(self) -> Optional[Dict[int, str]]: method _sanitize_model_config (line 475) | def _sanitize_model_config( method _sanitize_generate_config (line 485) | def _sanitize_generate_config( method _load_model (line 505) | def _load_model(self, **kwargs): method _load_model_shard (line 552) | def _load_model_shard(self, **kwargs): method _get_classes (line 617) | def _get_classes(config: dict): method load (line 643) | def load(self): method wait_for_load (line 695) | def wait_for_load(self): method check_lib (line 733) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 740) | def match_json( method _get_prompt_cache (line 753) | def _get_prompt_cache( method _generate_stream_inner (line 778) | def _generate_stream_inner(self, **kwargs): method _prepare_inputs (line 812) | def _prepare_inputs( method _generate_stream (line 821) | def _generate_stream( method _run_non_drivers (line 928) | def _run_non_drivers( method async_generate (line 959) | async def async_generate( class MLXChatModel (line 1106) | class MLXChatModel(MLXModel, ChatModelMixin): method _sanitize_generate_config (line 1109) | def _sanitize_generate_config( method match_json (line 1125) | def match_json( method async_chat (line 1138) | async def async_chat( class MLXVisionModel (line 1193) | class MLXVisionModel(MLXModel, ChatModelMixin): method check_lib (line 1197) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 1204) | def match_json( method generate (line 1215) | def generate( method wait_for_load (line 1270) | def wait_for_load(self): method _load_model (line 1278) | def _load_model(self, **kwargs): method load (line 1294) | def load(self): method _generate_stream_inner (line 1317) | def _generate_stream_inner(self, **kwargs): method _prepare_inputs (line 1380) | def _prepare_inputs( method chat (line 1439) | def chat( FILE: xinference/model/llm/mlx/distributed_models/core.py class ReceiverActor (line 32) | class ReceiverActor(xo.StatelessActor): method __init__ (line 33) | def __init__(self, *args, **kwargs): method gen_uid (line 39) | def gen_uid(cls, uid: str, rank: int): method send (line 42) | async def send(self, data: "mx.array"): method recv (line 49) | async def recv(self): class DistributedModelMixin (line 53) | class DistributedModelMixin: method __init__ (line 63) | def __init__(self): method prepare (line 73) | def prepare(self): method _send_stage_result (line 83) | def _send_stage_result(self, result: "mx.array"): method _wait_prev_stage_result (line 109) | def _wait_prev_stage_result(self): method _broadcast_result (line 122) | def _broadcast_result(self, result: "mx.array"): method _get_result (line 144) | def _get_result(self) -> "mx.array": method pipeline (line 154) | def pipeline(self): class SafeKVCache (line 167) | class SafeKVCache: method __init__ (line 174) | def __init__(self): method state (line 180) | def state(self): method state (line 193) | def state(self, v): method __getattr__ (line 203) | def __getattr__(self, name): FILE: xinference/model/llm/mlx/distributed_models/deepseek_v3.py class DeepseekV3Model (line 27) | class DeepseekV3Model(_DeepseekV3Model, DistributedModelMixin): method __init__ (line 28) | def __init__(self, *args, **kwargs): method __call__ (line 32) | def __call__( class Model (line 69) | class Model(_Model): method __init__ (line 70) | def __init__(self, config: ModelArgs): FILE: xinference/model/llm/mlx/distributed_models/qwen2.py class Qwen2Model (line 30) | class Qwen2Model(_Qwen2Model, DistributedModelMixin): method __init__ (line 31) | def __init__(self, *args, **kwargs): method __call__ (line 35) | def __call__( class Model (line 74) | class Model(_Model): method __init__ (line 75) | def __init__(self, args: ModelArgs): FILE: xinference/model/llm/mlx/distributed_models/qwen3.py class Qwen3Model (line 30) | class Qwen3Model(_Qwen3Model, DistributedModelMixin): method __init__ (line 31) | def __init__(self, *args, **kwargs): method __call__ (line 35) | def __call__( class Model (line 75) | class Model(_Model): method __init__ (line 76) | def __init__(self, args: ModelArgs): FILE: xinference/model/llm/mlx/distributed_models/qwen3_moe.py class Qwen3MoeModel (line 29) | class Qwen3MoeModel(_Qwen3MoeModel, DistributedModelMixin): method __init__ (line 30) | def __init__(self, *args, **kwargs): method __call__ (line 34) | def __call__( class Model (line 70) | class Model(_Model): method __init__ (line 71) | def __init__(self, args: ModelArgs): FILE: xinference/model/llm/mlx/tests/test_distributed_model.py class ModelActor (line 25) | class ModelActor(xo.StatelessActor): method __init__ (line 26) | def __init__(self, rank: int, model_uid: str, model_path: str): method set_rank_addresses (line 33) | def set_rank_addresses(self, rank_addresses): method _load (line 36) | def _load(self): method load (line 71) | async def load(self): method _generate (line 74) | def _generate(self, prompt: str, **kwargs): method generate (line 84) | async def generate(self, prompt: str, **kwargs): function setup_pool (line 89) | async def setup_pool(): function test_distributed (line 102) | async def test_distributed(setup_pool): FILE: xinference/model/llm/mlx/tests/test_mlx.py class InferenceThread (line 26) | class InferenceThread(threading.Thread): method __init__ (line 29) | def __init__(self, prompt, generate_config, model): method run (line 37) | def run(self): method join (line 62) | def join(self, timeout=None): function test_load_mlx (line 73) | def test_load_mlx(setup): function test_load_mlx_vision (line 102) | def test_load_mlx_vision(setup): function test_mlx_parallel_inference (line 153) | def test_mlx_parallel_inference(setup): FILE: xinference/model/llm/reasoning_parser.py class ReasoningParser (line 12) | class ReasoningParser: method __init__ (line 15) | def __init__( method extract_reasoning_content_streaming (line 32) | def extract_reasoning_content_streaming( method extract_reasoning_content (line 128) | def extract_reasoning_content( method check_content_parser (line 162) | def check_content_parser(self) -> bool: method _create_chat_completion_chunk (line 172) | def _create_chat_completion_chunk( method _create_completion_chunk (line 200) | def _create_completion_chunk( method is_enable_thinking (line 227) | def is_enable_thinking(self): method prepare_reasoning_content_streaming (line 233) | async def prepare_reasoning_content_streaming( method prepare_reasoning_content_sync (line 302) | def prepare_reasoning_content_sync(self, chunks: Iterator[CompletionCh... method prepare_reasoning_content (line 365) | def prepare_reasoning_content(self, completion): method prepare_first_reasoning_content_chunk (line 392) | def prepare_first_reasoning_content_chunk( FILE: xinference/model/llm/sglang/core.py class SGLANGModelConfig (line 50) | class SGLANGModelConfig(TypedDict, total=False): class SGLANGGenerateConfig (line 66) | class SGLANGGenerateConfig(TypedDict, total=False): class SGLANGModel (line 116) | class SGLANGModel(LLM): method __init__ (line 119) | def __init__( method driver_info (line 137) | def driver_info(self) -> Optional[dict]: method load (line 140) | def load(self): method wait_for_load (line 241) | def wait_for_load(self): method stop (line 252) | def stop(self): method _sanitize_model_config (line 256) | def _sanitize_model_config( method _apply_fp4_config (line 286) | def _apply_fp4_config(self, model_config: SGLANGModelConfig) -> None: method _sanitize_generate_config (line 299) | def _sanitize_generate_config( method check_lib (line 334) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 341) | def match_json( method _convert_state_to_completion_chunk (line 376) | def _convert_state_to_completion_chunk( method _convert_state_to_completion (line 413) | def _convert_state_to_completion( method _filter_sampling_params (line 450) | def _filter_sampling_params(cls, sampling_params: dict): method _stream_generate (line 455) | async def _stream_generate( method _non_stream_generate (line 494) | async def _non_stream_generate( method async_generate (line 514) | async def async_generate( class SGLANGChatModel (line 657) | class SGLANGChatModel(SGLANGModel, ChatModelMixin): method match_json (line 659) | def match_json( method _sanitize_chat_config (line 689) | def _sanitize_chat_config( method is_tool_call_chunk_start (line 702) | def is_tool_call_chunk_start(chunk): method is_tool_call_chunk_end (line 706) | def is_tool_call_chunk_end(chunk): method async_chat (line 709) | async def async_chat( class SGLANGVisionModel (line 756) | class SGLANGVisionModel(SGLANGModel, ChatModelMixin): method match_json (line 758) | def match_json( method _sanitize_chat_config (line 794) | def _sanitize_chat_config( method async_chat (line 805) | async def async_chat( FILE: xinference/model/llm/tests/test_harmony.py function test_streaming_parser_multiple_texts (line 20) | def test_streaming_parser_multiple_texts(): function test_harmony_streaming_and_nonstreaming (line 59) | async def test_harmony_streaming_and_nonstreaming(): function test_async_stream_chunks (line 443) | async def test_async_stream_chunks(): FILE: xinference/model/llm/tests/test_llm_family.py function test_deserialize_llm_family_v1 (line 36) | def test_deserialize_llm_family_v1(): function test_cache_from_huggingface_pytorch (line 114) | def test_cache_from_huggingface_pytorch(): function test_cache_from_huggingface_gguf (line 142) | def test_cache_from_huggingface_gguf(): function test_cache_from_uri_local (line 176) | def test_cache_from_uri_local(): function test_custom_llm (line 209) | def test_custom_llm(): function test_persistent_custom_llm (line 240) | def test_persistent_custom_llm(): function test_is_locale_chinese_simplified (line 278) | def test_is_locale_chinese_simplified(): function test_match_llm (line 292) | def test_match_llm(): function test_is_valid_file_uri (line 327) | def test_is_valid_file_uri(): function test_get_cache_status_pytorch (line 333) | def test_get_cache_status_pytorch(): function test_get_cache_status_gguf (line 371) | def test_get_cache_status_gguf(): function test_parse_chat_template (line 407) | def test_parse_chat_template(): function test_match_model_size (line 520) | def test_match_model_size(): function test_convert_model_size_to_float (line 537) | def test_convert_model_size_to_float(): function test_quert_engine_vLLM (line 548) | def test_quert_engine_vLLM(): function test_quert_engine_SGLang (line 608) | def test_quert_engine_SGLang(): function test_query_engine_general (line 665) | def test_query_engine_general(): FILE: xinference/model/llm/tests/test_llm_model.py function test_restful_api_for_deepseek_with_reasoning (line 42) | async def test_restful_api_for_deepseek_with_reasoning( function test_restful_api_for_deepseek_without_reasoning (line 103) | async def test_restful_api_for_deepseek_without_reasoning( function test_qwen3_with_thinking_params (line 171) | async def test_qwen3_with_thinking_params( function test_qwen3_with_tools (line 237) | async def test_qwen3_with_tools(setup): function setup_cluster (line 340) | def setup_cluster(): function test_qwen3_enable_thinking (line 385) | async def test_qwen3_enable_thinking( FILE: xinference/model/llm/tests/test_memory_estimate.py function test_llm_estimate_memory (line 18) | def test_llm_estimate_memory(): FILE: xinference/model/llm/tests/test_multimodal.py function test_restful_api_for_qwen_vl (line 24) | def test_restful_api_for_qwen_vl(setup, model_format, quantization): function test_restful_api_for_yi_vl (line 136) | def test_restful_api_for_yi_vl(setup, model_format, quantization): function test_restful_api_for_deepseek_vl (line 224) | def test_restful_api_for_deepseek_vl(setup, model_format, quantization): function test_restful_api_for_qwen_audio (line 326) | def test_restful_api_for_qwen_audio(setup): FILE: xinference/model/llm/tests/test_stream_options.py function test_openai_stream_options_llamacpp_chatglm (line 27) | async def test_openai_stream_options_llamacpp_chatglm(setup): function test_openai_stream_options_llamacpp (line 115) | async def test_openai_stream_options_llamacpp(setup): function test_openai_stream_options_pytorch_chatglm (line 204) | async def test_openai_stream_options_pytorch_chatglm(setup): function test_openai_stream_options_pytorch (line 294) | async def test_openai_stream_options_pytorch(setup): function test_openai_stream_options_pytorch_deepseek_vl (line 384) | async def test_openai_stream_options_pytorch_deepseek_vl(setup): function test_openai_stream_options_pytorch_internlm2 (line 474) | async def test_openai_stream_options_pytorch_internlm2(setup): function test_openai_stream_options_pytorch_qwen_vl (line 564) | async def test_openai_stream_options_pytorch_qwen_vl(setup): function test_openai_stream_options_pytorch_yi_vl (line 654) | async def test_openai_stream_options_pytorch_yi_vl(setup): function test_openai_stream_options_sgalng (line 744) | async def test_openai_stream_options_sgalng(setup): function test_openai_stream_options_vllm (line 834) | async def test_openai_stream_options_vllm(setup): function test_openai_stream_tools_vllm (line 924) | async def test_openai_stream_tools_vllm(setup): FILE: xinference/model/llm/tests/test_utils.py function test_is_valid_model_name (line 20) | def test_is_valid_model_name(): function filter_ids_and_created (line 36) | def filter_ids_and_created(data): function test_post_process_completion_chunk_without_thinking (line 48) | def test_post_process_completion_chunk_without_thinking(): function test_post_process_completion_chunk_with_thinking (line 448) | def test_post_process_completion_chunk_with_thinking(): function test_post_process_completion_chunk_with_parser (line 1018) | def test_post_process_completion_chunk_with_parser(): function test_post_process_completion_without_thinking (line 1522) | def test_post_process_completion_without_thinking(): function test_post_process_completion_with_thinking (line 1580) | def test_post_process_completion_with_thinking(): function test_post_process_completion_with_parser (line 1636) | def test_post_process_completion_with_parser(): FILE: xinference/model/llm/tool_parsers/__init__.py function register_tool_parser (line 8) | def register_tool_parser(name: str): FILE: xinference/model/llm/tool_parsers/abstract_tool_parser.py class ToolParser (line 1) | class ToolParser: method extract_tool_calls (line 8) | def extract_tool_calls(self, model_output: str): method extract_tool_calls_streaming (line 20) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/deepseek_r1_tool_parser.py class DeepseekR1ToolParser (line 13) | class DeepseekR1ToolParser(ToolParser): method __init__ (line 21) | def __init__(self): method extract_tool_calls (line 47) | def extract_tool_calls( method _get_function_calls (line 137) | def _get_function_calls(self, model_output: str) -> List[str]: method extract_tool_calls_streaming (line 164) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/deepseek_v3_1_tool_parser.py class DeepseekV3_1ToolParser (line 13) | class DeepseekV3_1ToolParser(ToolParser): method __init__ (line 22) | def __init__(self): method extract_tool_calls (line 33) | def extract_tool_calls( method extract_tool_calls_streaming (line 104) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/deepseek_v3_tool_parser.py class DeepseekV3ToolParser (line 13) | class DeepseekV3ToolParser(ToolParser): method __init__ (line 22) | def __init__(self): method _parse_json_function_call (line 30) | def _parse_json_function_call( method extract_tool_calls (line 50) | def extract_tool_calls( method extract_tool_calls_streaming (line 123) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/glm4_tool_parser.py class Glm4ToolParser (line 12) | class Glm4ToolParser(ToolParser): method __init__ (line 21) | def __init__(self): method _parse_json_function_call (line 29) | def _parse_json_function_call( method extract_tool_calls (line 49) | def extract_tool_calls( method extract_tool_calls_streaming (line 94) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/llama3_tool_parser.py class Llama3ToolParser (line 11) | class Llama3ToolParser(ToolParser): method __init__ (line 20) | def __init__(self): method extract_tool_calls (line 26) | def extract_tool_calls( method extract_tool_calls_streaming (line 51) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/minimax_tool_parser.py class MiniMaxToolParser (line 13) | class MiniMaxToolParser(ToolParser): method __init__ (line 21) | def __init__(self): method _parse_param_value (line 46) | def _parse_param_value(self, value: str) -> Any: method _parse_invoke_calls (line 55) | def _parse_invoke_calls(self, tool_block: str) -> List[Tuple[str, Dict... method _get_function_calls (line 64) | def _get_function_calls(self, model_output: str) -> List[str]: method _get_function_calls_streaming (line 76) | def _get_function_calls_streaming(self, model_output: str) -> List[str]: method is_contain_think (line 80) | def is_contain_think(self, model_output: str) -> bool: method _has_unclosed_tool_call (line 83) | def _has_unclosed_tool_call(self, text: str) -> bool: method extract_tool_calls (line 90) | def extract_tool_calls( method extract_tool_calls_streaming (line 124) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/qwen_tool_parser.py class QwenToolParser (line 13) | class QwenToolParser(ToolParser): method __init__ (line 22) | def __init__(self): method _parse_json_function_call (line 47) | def _parse_json_function_call( method _parse_json_function_call_stream (line 85) | def _parse_json_function_call_stream( method is_contain_think_end_token (line 105) | def is_contain_think_end_token(self, model_output: str) -> bool: method is_contain_think (line 117) | def is_contain_think(self, model_output: str) -> bool: method is_contain_tool_call (line 129) | def is_contain_tool_call(self, model_output: str) -> bool: method is_contain_tool_call_start_token (line 141) | def is_contain_tool_call_start_token(self, model_output: str) -> bool: method is_contain_tool_call_end_token (line 153) | def is_contain_tool_call_end_token(self, model_output: str) -> bool: method _get_function_calls (line 165) | def _get_function_calls(self, model_output: str) -> List[str]: method _get_function_calls_streaming (line 192) | def _get_function_calls_streaming(self, model_output: str) -> List[str]: method extract_tool_calls (line 207) | def extract_tool_calls( method _has_unclosed_tool_call (line 275) | def _has_unclosed_tool_call(self, text: str) -> bool: method extract_tool_calls_streaming (line 294) | def extract_tool_calls_streaming( FILE: xinference/model/llm/tool_parsers/tests/test_deepseek_r1_tool_parser.py function test_tool_parser_extract_calls_without_thinking (line 4) | def test_tool_parser_extract_calls_without_thinking(): FILE: xinference/model/llm/tool_parsers/tests/test_deepseek_v3_1_tool_parser.py function test_extract_tool_calls_single_call (line 4) | def test_extract_tool_calls_single_call(): function test_extract_tool_calls_multiple_calls (line 17) | def test_extract_tool_calls_multiple_calls(): function test_extract_tool_calls_no_tool_call (line 36) | def test_extract_tool_calls_no_tool_call(): function test_extract_tool_calls_streaming_full_sequence (line 217) | def test_extract_tool_calls_streaming_full_sequence(): function test_extract_tool_calls_streaming_multi_sequence (line 242) | def test_extract_tool_calls_streaming_multi_sequence(): function test_extract_tool_calls_streaming_split_token (line 268) | def test_extract_tool_calls_streaming_split_token(): function test_extract_tool_calls_invalid_json (line 301) | def test_extract_tool_calls_invalid_json(): FILE: xinference/model/llm/tool_parsers/tests/test_deepseek_v3_tool_parser.py function test_tool_parser_extract_calls_without_thinking (line 4) | def test_tool_parser_extract_calls_without_thinking(): FILE: xinference/model/llm/tool_parsers/tests/test_glm4_tool_parser.py function test_tool_parser_extract_calls (line 4) | def test_tool_parser_extract_calls(): function test_tool_parser_extract_calls_streaming (line 16) | def test_tool_parser_extract_calls_streaming(): FILE: xinference/model/llm/tool_parsers/tests/test_qwen_tool_parser.py function test_tool_parser_extract_calls_streaming_without_thinking_multi (line 4) | def test_tool_parser_extract_calls_streaming_without_thinking_multi(): function test_tool_parser_extract_calls_streaming_without_thinking (line 287) | def test_tool_parser_extract_calls_streaming_without_thinking(): function test_tool_parser_extract_calls_streaming_with_thinking (line 410) | def test_tool_parser_extract_calls_streaming_with_thinking(): function test_tool_parser_extract_calls_streaming_with_parser (line 583) | def test_tool_parser_extract_calls_streaming_with_parser(): function test_tool_parser_extract_calls_without_thinking_multi (line 714) | def test_tool_parser_extract_calls_without_thinking_multi(): function test_tool_parser_extract_calls_without_thinking (line 729) | def test_tool_parser_extract_calls_without_thinking(): function test_tool_parser_extract_calls_with_thinking (line 741) | def test_tool_parser_extract_calls_with_thinking(): function test_tool_parser_extract_calls_with_parser (line 757) | def test_tool_parser_extract_calls_with_parser(): FILE: xinference/model/llm/transformers/__init__.py function import_submodules (line 22) | def import_submodules(package_path: str, package_name: str, globals_dict... FILE: xinference/model/llm/transformers/chatglm.py class ChatglmPytorchChatModel (line 39) | class ChatglmPytorchChatModel(PytorchChatModel): method __init__ (line 42) | def __init__( method _get_model_class (line 58) | def _get_model_class(self): method _load_model (line 63) | def _load_model(self, **kwargs): method match_json (line 88) | def match_json( method _handle_tools (line 102) | def _handle_tools(self, messages, generate_config): method _process_messages (line 120) | def _process_messages(messages, tools=None, tool_choice="none"): method _process_response_non_streaming (line 208) | def _process_response_non_streaming( method _process_response_streaming (line 268) | def _process_response_streaming(output, tools, end=False): method _stream_chat (line 299) | def _stream_chat(self, inputs, tools, **kwargs): method _get_generate_kwargs (line 327) | def _get_generate_kwargs(generate_config): method chat (line 352) | def chat( # type: ignore method prepare_sanitize_generate_config (line 445) | def prepare_sanitize_generate_config(self, req: InferenceRequest): method prepare_batch_inference (line 459) | def prepare_batch_inference(self, req_list: List[InferenceRequest]): method handle_chat_result_non_streaming (line 495) | def handle_chat_result_non_streaming(self, req: InferenceRequest): method handle_chat_result_streaming (line 509) | def handle_chat_result_streaming(self, req: InferenceRequest): FILE: xinference/model/llm/transformers/core.py function register_non_default_model (line 63) | def register_non_default_model(*architectures: str): class PytorchModel (line 92) | class PytorchModel(LLM): method __init__ (line 95) | def __init__( method _sanitize_model_config (line 111) | def _sanitize_model_config( method _sanitize_generate_config (line 129) | def _sanitize_generate_config( method _check_tensorizer_integrity (line 145) | def _check_tensorizer_integrity(self): method _load_tensorizer (line 158) | def _load_tensorizer(self, **kwargs): method _save_tensorizer (line 172) | def _save_tensorizer(self, **kwargs): method _get_model_class (line 180) | def _get_model_class(self): method _get_components (line 185) | def _get_components(self, **kwargs): method _load_model (line 202) | def _load_model(self, **kwargs): method _apply_lora (line 227) | def _apply_lora(self): method apply_bnb_quantization (line 251) | def apply_bnb_quantization( method apply_fp_quantization (line 277) | def apply_fp_quantization( method apply_quantization_config (line 313) | def apply_quantization_config( method load (line 322) | def load(self): method _should_use_batching (line 410) | def _should_use_batching(self) -> bool: method _ensure_scheduler_started (line 439) | async def _ensure_scheduler_started(self): method generate (line 444) | async def generate(self, prompt: str, generate_config: Optional[dict] ... method _direct_generate (line 475) | async def _direct_generate( method _queue_to_async_generator (line 481) | async def _queue_to_async_generator(self, queue): method abort_request (line 502) | async def abort_request(self, request_id: str) -> Optional[str]: method stop_scheduler (line 510) | async def stop_scheduler(self): method stop (line 515) | def stop(self): method check_lib (line 537) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 544) | def match_json( method build_prefill_attention_mask (line 561) | def build_prefill_attention_mask( method build_decode_attention_mask (line 594) | def build_decode_attention_mask( method build_prefill_position_ids (line 631) | def build_prefill_position_ids( method build_decode_position_ids (line 654) | def build_decode_position_ids( method build_prefill_token_type_ids (line 668) | def build_prefill_token_type_ids( method build_decode_token_type_ids (line 677) | def build_decode_token_type_ids( method build_prefill_inputs (line 686) | def build_prefill_inputs(self, prompts: List, req_list: List[Inference... method build_prefill_kwargs (line 698) | def build_prefill_kwargs(self, prompts: List, req_list: List[Inference... method build_decode_kwargs (line 720) | def build_decode_kwargs( method get_batch_size_and_seq_len_indexes_from_kv (line 743) | def get_batch_size_and_seq_len_indexes_from_kv() -> Tuple[int, int]: method get_dtype (line 751) | def get_dtype(self): method get_context_len (line 755) | def get_context_len(self): method get_max_num_seqs (line 759) | def get_max_num_seqs(self) -> int: method prepare_sanitize_generate_config (line 762) | def prepare_sanitize_generate_config(self, req: InferenceRequest): method merge_kv_cache (line 765) | def merge_kv_cache(self, past_cache, new_cache): method prepare_batch_inference (line 870) | def prepare_batch_inference(self, req_list: List[InferenceRequest]): method get_builtin_stop_token_ids (line 904) | def get_builtin_stop_token_ids(self) -> Tuple: method handle_batch_inference_results (line 921) | def handle_batch_inference_results(self, req_list: List[InferenceReque... method batch_inference (line 956) | def batch_inference(self, req_list: List[InferenceRequest]): method build_reduced_kv_cache (line 965) | def build_reduced_kv_cache(self, cache, skipped_indexes: Set[int]): class PytorchChatModel (line 976) | class PytorchChatModel(PytorchModel, ChatModelMixin): method __init__ (line 977) | def __init__( method _sanitize_generate_config (line 993) | def _sanitize_generate_config( method match_json (line 1009) | def match_json( method chat (line 1026) | async def chat( method _direct_chat (line 1061) | async def _direct_chat( method load (line 1069) | def load(self): method _get_full_prompt (line 1072) | def _get_full_prompt(self, messages: List[Dict], tools, generate_confi... method prepare_batch_inference (line 1098) | def prepare_batch_inference(self, req_list: List[InferenceRequest]): method handle_chat_result_non_streaming (line 1114) | def handle_chat_result_non_streaming(self, req: InferenceRequest): method handle_chat_result_streaming (line 1126) | def handle_chat_result_streaming(self, req: InferenceRequest): method handle_batch_inference_results (line 1151) | def handle_batch_inference_results(self, req_list: List[InferenceReque... FILE: xinference/model/llm/transformers/deepseek_v2.py class DeepSeekV2PytorchChatModel (line 27) | class DeepSeekV2PytorchChatModel(PytorchChatModel): method _load_model (line 30) | def _load_model(self, **kwargs): method match_json (line 64) | def match_json( FILE: xinference/model/llm/transformers/gemma3.py class Gemma3TextChatModel (line 26) | class Gemma3TextChatModel(PytorchChatModel): method match_json (line 30) | def match_json( method _load_model (line 45) | def _load_model(self, **kwargs): method _get_full_prompt (line 62) | def _get_full_prompt(self, messages: List[Dict], tools, generate_confi... method build_prefill_kwargs (line 65) | def build_prefill_kwargs(self, prompts: List, req_list: List[Inference... method merge_kv_cache (line 94) | def merge_kv_cache(self, past_cache, new_cache): method build_decode_attention_mask (line 128) | def build_decode_attention_mask( method build_decode_position_ids (line 136) | def build_decode_position_ids( method build_reduced_kv_cache (line 144) | def build_reduced_kv_cache(self, cache, skipped_indexes: Set[int]): FILE: xinference/model/llm/transformers/gpt_oss.py class GPTOSSPytorchChatModel (line 33) | class GPTOSSPytorchChatModel(PytorchChatModel): method _sanitize_model_config (line 36) | def _sanitize_model_config( method match_json (line 44) | def match_json( method chat (line 61) | async def chat( # type:ignore FILE: xinference/model/llm/transformers/multimodal/cogagent.py class CogAgentChatModel (line 34) | class CogAgentChatModel(PytorchMultiModalModel): method __init__ (line 37) | def __init__(self, *args, **kws): method match_json (line 51) | def match_json( method decide_device (line 63) | def decide_device(self): method load_processor (line 67) | def load_processor(self): method load_multimodal_model (line 74) | def load_multimodal_model(self): method _message_content_to_cogagent (line 86) | def _message_content_to_cogagent(self, content): method _history_content_to_cogagent (line 115) | def _history_content_to_cogagent(self, chat_history: List[Dict]): method _get_query_and_history (line 156) | def _get_query_and_history( method build_inputs_from_messages (line 184) | def build_inputs_from_messages( method build_generate_kwargs (line 216) | def build_generate_kwargs( method build_streaming_iter (line 229) | def build_streaming_iter( FILE: xinference/model/llm/transformers/multimodal/core.py class PytorchMultiModalModel (line 29) | class PytorchMultiModalModel(PytorchChatModel): method __init__ (line 30) | def __init__(self, *args, **kwargs): method decide_device (line 38) | def decide_device(self): method load_processor (line 45) | def load_processor(self): method load_multimodal_model (line 52) | def load_multimodal_model(self): method load (line 58) | def load(self): method build_inputs_from_messages (line 70) | def build_inputs_from_messages( method build_generate_kwargs (line 83) | def build_generate_kwargs( method build_streaming_iter (line 94) | def build_streaming_iter( method get_stop_strs (line 106) | def get_stop_strs(self) -> List[str]: method check_conditions (line 109) | def check_conditions(self, new_text: str) -> Tuple[str, bool]: method generate_non_streaming (line 117) | def generate_non_streaming( method generate_streaming (line 149) | def generate_streaming( method chat (line 271) | def chat( FILE: xinference/model/llm/transformers/multimodal/deepseek_vl2.py class DeepSeekVL2ChatModel (line 35) | class DeepSeekVL2ChatModel(PytorchMultiModalModel): method __init__ (line 38) | def __init__(self, *args, **kwargs): method match_json (line 43) | def match_json( method decide_device (line 55) | def decide_device(self): method load_processor (line 60) | def load_processor(self): method load_multimodal_model (line 69) | def load_multimodal_model(self): method _message_content_to_deepseek (line 85) | def _message_content_to_deepseek(content) -> Tuple[str, List[str]]: method get_stop_strs (line 148) | def get_stop_strs(self) -> List[str]: method build_generate_kwargs (line 153) | def build_generate_kwargs(self, generate_config: Dict): method build_inputs_from_messages (line 157) | def build_inputs_from_messages( method build_streaming_iter (line 213) | def build_streaming_iter( method check_conditions (line 228) | def check_conditions(self, new_text: str) -> Tuple[str, bool]: FILE: xinference/model/llm/transformers/multimodal/gemma3.py class Gemma3ChatModel (line 29) | class Gemma3ChatModel(PytorchMultiModalModel): method match_json (line 33) | def match_json( method _sanitize_model_config (line 48) | def _sanitize_model_config( method decide_device (line 57) | def decide_device(self): method load_processor (line 62) | def load_processor(self): method load_multimodal_model (line 74) | def load_multimodal_model(self): method build_inputs_from_messages (line 82) | def build_inputs_from_messages( method build_generate_kwargs (line 97) | def build_generate_kwargs( method build_streaming_iter (line 106) | def build_streaming_iter( FILE: xinference/model/llm/transformers/multimodal/glm4_1v.py class Glm4_1VModel (line 35) | class Glm4_1VModel(PytorchMultiModalModel): method match_json (line 42) | def match_json( method decide_device (line 54) | def decide_device(self): method load_processor (line 58) | def load_processor(self): method load_multimodal_model (line 64) | def load_multimodal_model(self): method _get_processed_msgs (line 79) | def _get_processed_msgs(messages: List[Dict]) -> List[Dict]: method build_inputs_from_messages (line 120) | def build_inputs_from_messages( method get_stop_strs (line 146) | def get_stop_strs(self) -> List[str]: method get_builtin_stop_token_ids (line 149) | def get_builtin_stop_token_ids(self) -> Tuple: method build_generate_kwargs (line 154) | def build_generate_kwargs( method build_streaming_iter (line 166) | def build_streaming_iter( FILE: xinference/model/llm/transformers/multimodal/glm4v.py class Glm4VModel (line 37) | class Glm4VModel(PytorchMultiModalModel): method match_json (line 44) | def match_json( method decide_device (line 56) | def decide_device(self): method load_processor (line 60) | def load_processor(self): method load_multimodal_model (line 67) | def load_multimodal_model(self): method _get_processed_msgs (line 83) | def _get_processed_msgs(messages: List[Dict]) -> List[Dict]: method build_inputs_from_messages (line 118) | def build_inputs_from_messages( method build_generate_kwargs (line 134) | def build_generate_kwargs( method get_stop_strs (line 145) | def get_stop_strs(self) -> List[str]: method build_streaming_iter (line 148) | def build_streaming_iter( method _get_full_prompt (line 172) | def _get_full_prompt(self, messages, tools, generate_config: dict): method prepare_sanitize_generate_config (line 186) | def prepare_sanitize_generate_config(self, req: InferenceRequest): method build_prefill_inputs (line 199) | def build_prefill_inputs(self, prompts: List, req_list: List[Inference... method is_empty (line 236) | def is_empty(images_list: Optional[List[List[torch.Tensor]]]): method get_full_attention_mask (line 248) | def get_full_attention_mask( method build_prefill_kwargs (line 286) | def build_prefill_kwargs(self, prompts: List, req_list: List[Inference... method build_decode_attention_mask (line 304) | def build_decode_attention_mask( FILE: xinference/model/llm/transformers/multimodal/intern_vl.py class InternVLChatModel (line 32) | class InternVLChatModel(PytorchMultiModalModel): method match_json (line 39) | def match_json( method decide_device (line 51) | def decide_device(self): method load_processor (line 82) | def load_processor(self): method load_multimodal_model (line 89) | def load_multimodal_model(self): method _build_transform (line 106) | def _build_transform(self, input_size=448): method _get_index (line 125) | def _get_index(bound, fps, max_frame, first_idx=0, num_segments=32): method _find_closest_aspect_ratio (line 143) | def _find_closest_aspect_ratio( method _dynamic_preprocess (line 160) | def _dynamic_preprocess( method _load_video (line 205) | def _load_video( method _message_content_to_intern (line 233) | def _message_content_to_intern(self, content, image_cnt): method _get_prompt_and_chat_history (line 270) | def _get_prompt_and_chat_history( method _load_image (line 295) | def _load_image(self, image_file, input_size=448, max_num=12): method build_inputs_from_messages (line 305) | def build_inputs_from_messages( method build_generate_kwargs (line 383) | def build_generate_kwargs( method build_streaming_iter (line 393) | def build_streaming_iter( method check_conditions (line 415) | def check_conditions(self, new_text: str) -> Tuple[str, bool]: FILE: xinference/model/llm/transformers/multimodal/minicpmv26.py class MiniCPMV26Model (line 36) | class MiniCPMV26Model(PytorchMultiModalModel): method match_json (line 40) | def match_json( method _sanitize_model_config (line 52) | def _sanitize_model_config( method decide_device (line 61) | def decide_device(self): method load_processor (line 70) | def load_processor(self): method load_multimodal_model (line 86) | def load_multimodal_model(self): method _message_content_to_chat (line 109) | def _message_content_to_chat(self, content): method _convert_to_specific_style (line 167) | def _convert_to_specific_style(self, messages: List[Dict]) -> Tuple: method build_inputs_from_messages (line 203) | def build_inputs_from_messages( method build_generate_kwargs (line 215) | def build_generate_kwargs( method build_streaming_iter (line 221) | def build_streaming_iter( method prepare_sanitize_generate_config (line 234) | def prepare_sanitize_generate_config(self, req: InferenceRequest): method _handle_input_ids_and_images (line 253) | def _handle_input_ids_and_images(self, msgs: List[Dict]) -> Dict: method _get_full_prompt (line 286) | def _get_full_prompt(self, messages: List[Dict], tools, generate_confi... method build_prefill_kwargs (line 294) | def build_prefill_kwargs(self, prompts: List, req_list: List[Inference... method build_decode_position_ids (line 327) | def build_decode_position_ids( method batch_inference (line 332) | def batch_inference(self, req_list: List[InferenceRequest]): FILE: xinference/model/llm/transformers/multimodal/minicpmv45.py class MiniCPMV45Model (line 36) | class MiniCPMV45Model(PytorchMultiModalModel): method match_json (line 40) | def match_json( method _sanitize_model_config (line 52) | def _sanitize_model_config( method decide_device (line 62) | def decide_device(self): method load_processor (line 71) | def load_processor(self): method load_multimodal_model (line 87) | def load_multimodal_model(self): method _message_content_to_chat (line 110) | def _message_content_to_chat(self, content): method _convert_to_specific_style (line 168) | def _convert_to_specific_style(self, messages: List[Dict]) -> Tuple: method build_inputs_from_messages (line 204) | def build_inputs_from_messages( method build_generate_kwargs (line 216) | def build_generate_kwargs( method build_streaming_iter (line 222) | def build_streaming_iter( method prepare_sanitize_generate_config (line 235) | def prepare_sanitize_generate_config(self, req: InferenceRequest): method _handle_input_ids_and_images (line 254) | def _handle_input_ids_and_images(self, msgs: List[Dict]) -> Dict: method _get_full_prompt (line 288) | def _get_full_prompt(self, messages: List[Dict], tools, generate_confi... method build_prefill_kwargs (line 296) | def build_prefill_kwargs(self, prompts: List, req_list: List[Inference... method build_decode_position_ids (line 329) | def build_decode_position_ids( method batch_inference (line 334) | def batch_inference(self, req_list: List[InferenceRequest]): FILE: xinference/model/llm/transformers/multimodal/ovis2.py class Ovis2ChatModel (line 30) | class Ovis2ChatModel(PytorchMultiModalModel): method __init__ (line 33) | def __init__(self, *args, **kws): method match_json (line 39) | def match_json( method decide_device (line 56) | def decide_device(self): method load_processor (line 59) | def load_processor(self): method load_multimodal_model (line 62) | def load_multimodal_model(self): method _parse_messages_ovis (line 77) | def _parse_messages_ovis(messages: List[Dict]) -> List[Dict]: method _convert_video_tensors_to_pil (line 96) | def _convert_video_tensors_to_pil(video_inputs: List) -> List[Image.Im... method _generate_chat_data (line 137) | def _generate_chat_data(self, messages: List[Dict]): method build_generate_kwargs (line 194) | def build_generate_kwargs( method build_inputs_from_messages (line 210) | def build_inputs_from_messages( method build_streaming_iter (line 232) | def build_streaming_iter( FILE: xinference/model/llm/transformers/multimodal/qwen-omni.py class QwenOmniChatModel (line 43) | class QwenOmniChatModel(PytorchMultiModalModel): method __init__ (line 53) | def __init__(self, *args, **kwargs): method match_json (line 62) | def match_json( method decide_device (line 87) | def decide_device(self): method load_processor (line 92) | def load_processor(self): method load_multimodal_model (line 103) | def load_multimodal_model(self): method _transform_messages (line 132) | def _transform_messages( method build_inputs_from_messages (line 150) | def build_inputs_from_messages( method build_generate_kwargs (line 181) | def build_generate_kwargs( method build_streaming_iter (line 192) | def build_streaming_iter( method generate_non_streaming (line 211) | def generate_non_streaming( FILE: xinference/model/llm/transformers/multimodal/qwen2_audio.py class Qwen2AudioChatModel (line 32) | class Qwen2AudioChatModel(PytorchMultiModalModel): method match_json (line 36) | def match_json( method decide_device (line 48) | def decide_device(self): method load_processor (line 52) | def load_processor(self): method load_multimodal_model (line 64) | def load_multimodal_model(self): method _transform_messages (line 76) | def _transform_messages( method build_inputs_from_messages (line 99) | def build_inputs_from_messages( method build_generate_kwargs (line 113) | def build_generate_kwargs( method build_streaming_iter (line 119) | def build_streaming_iter( FILE: xinference/model/llm/transformers/multimodal/qwen2_vl.py class Qwen2VLChatModel (line 44) | class Qwen2VLChatModel(PytorchMultiModalModel): method _sanitize_model_config (line 52) | def _sanitize_model_config( method match_json (line 62) | def match_json( method decide_device (line 86) | def decide_device(self): method load_processor (line 92) | def load_processor(self): method load_multimodal_model (line 105) | def load_multimodal_model(self): method build_inputs_from_messages (line 176) | def build_inputs_from_messages( method build_generate_kwargs (line 199) | def build_generate_kwargs(self, generate_config: Dict) -> Dict[str, Any]: method build_streaming_iter (line 204) | def build_streaming_iter( method prepare_sanitize_generate_config (line 232) | def prepare_sanitize_generate_config(self, req: InferenceRequest): method _get_full_prompt (line 244) | def _get_full_prompt(self, messages: List[Dict], tools, generate_confi... method build_prefill_kwargs (line 247) | def build_prefill_kwargs(self, prompts: List, req_list: List[Inference... FILE: xinference/model/llm/transformers/opt.py class OptPytorchModel (line 25) | class OptPytorchModel(PytorchModel): method __init__ (line 28) | def __init__( method match_json (line 45) | def match_json( method build_prefill_position_ids (line 57) | def build_prefill_position_ids( method build_decode_position_ids (line 67) | def build_decode_position_ids( FILE: xinference/model/llm/transformers/tensorizer_utils.py function _filter_kwargs (line 41) | def _filter_kwargs(kwargs): function _file_is_non_empty (line 48) | def _file_is_non_empty( function get_tensorizer_dir (line 57) | def get_tensorizer_dir(model_path: str) -> str: function check_tensorizer_integrity (line 62) | def check_tensorizer_integrity( function load_from_tensorizer (line 79) | def load_from_tensorizer( function _load_pretrained_from_tensorizer (line 131) | def _load_pretrained_from_tensorizer( function _load_model_from_tensorizer (line 168) | def _load_model_from_tensorizer( function save_to_tensorizer (line 260) | def save_to_tensorizer( function _tensorizer_serialize_model (line 276) | def _tensorizer_serialize_model( function _tensorizer_serialize_pretrained (line 310) | def _tensorizer_serialize_pretrained( FILE: xinference/model/llm/transformers/tests/test_opt.py function test_opt_pytorch_model (line 25) | async def test_opt_pytorch_model(setup, quantization): function test_opt_fp4_model (line 76) | async def test_opt_fp4_model(setup): FILE: xinference/model/llm/transformers/tests/test_tensorizer.py class TestTensorizerSerializeModel (line 19) | class TestTensorizerSerializeModel: method setup_and_teardown (line 21) | def setup_and_teardown(self): method _cleanup_directory (line 64) | def _cleanup_directory(self, directory): method test_tensor_file_exists (line 69) | def test_tensor_file_exists(self): function mock_environment (line 95) | def mock_environment(tmp_path): function test_tensorizer_serialize_model_cache_exists (line 108) | def test_tensorizer_serialize_model_cache_exists( FILE: xinference/model/llm/transformers/utils.py function get_context_length (line 47) | def get_context_length(config) -> int: function prepare_logits_processor (line 70) | def prepare_logits_processor( function _get_token_from_logits (line 86) | def _get_token_from_logits( function _pad_to_max_length (line 115) | def _pad_to_max_length(x: List[int], max_len: int, pad: int) -> List[int]: function _pad_seqs_inplace (line 120) | def _pad_seqs_inplace(seqs: List[List[int]], reqs: List[InferenceRequest... function get_max_src_len (line 132) | def get_max_src_len(context_len: int, r: InferenceRequest) -> int: function pad_prefill_tokens (line 140) | def pad_prefill_tokens( function _get_completion (line 153) | def _get_completion( function _get_pad_param (line 188) | def _get_pad_param(seq_len_idx: int, pad_len: int) -> Tuple: function get_batch_size_and_seq_len_from_kv_cache (line 194) | def get_batch_size_and_seq_len_from_kv_cache(kv, xinf_model_obj: "Pytorc... function convert_to_cache_cls (line 216) | def convert_to_cache_cls(cache) -> DynamicCache: function _batch_inference_one_step_internal (line 226) | def _batch_inference_one_step_internal( function batch_inference_one_step (line 484) | def batch_inference_one_step( FILE: xinference/model/llm/utils.py class ChatModelMixin (line 110) | class ChatModelMixin: method __init__ (line 111) | def __init__(self): method _compile_jinja_template (line 119) | def _compile_jinja_template(chat_template): method _build_from_raw_template (line 136) | def _build_from_raw_template( method get_full_context (line 145) | def get_full_context( method _get_chat_template_kwargs_from_generate_config (line 179) | def _get_chat_template_kwargs_from_generate_config( method convert_messages_with_content_list_to_str_conversion (line 205) | def convert_messages_with_content_list_to_str_conversion( method get_specific_prompt (line 224) | def get_specific_prompt(model_family: str, messages: List[ChatCompleti... method _to_chat_completion_chunk (line 294) | def _to_chat_completion_chunk( method _get_first_chat_completion_chunk (line 386) | def _get_first_chat_completion_chunk( method _get_final_chat_completion_chunk (line 418) | def _get_final_chat_completion_chunk( method _to_chat_completion_chunks (line 438) | def _to_chat_completion_chunks( method _tools_to_messages_for_deepseek (line 476) | def _tools_to_messages_for_deepseek( method _async_to_chat_completion_chunks (line 505) | async def _async_to_chat_completion_chunks( method _to_chat_completion (line 543) | def _to_chat_completion( method _eval_glm_chat_arguments (line 600) | def _eval_glm_chat_arguments(c) -> List[Tuple]: method _handle_qwen_tool_result (line 617) | def _handle_qwen_tool_result(cls, text: str) -> List[Tuple]: method _eval_qwen_chat_arguments (line 686) | def _eval_qwen_chat_arguments( method _eval_llama3_chat_arguments (line 695) | def _eval_llama3_chat_arguments(cls, c) -> List[Tuple]: method _eval_deepseek_chat_arguments (line 704) | def _eval_deepseek_chat_arguments(cls, c) -> List[Tuple]: method _eval_deepseek_r1_arguments (line 772) | def _eval_deepseek_r1_arguments(cls, c) -> List[Tuple]: method _eval_tool_arguments (line 818) | def _eval_tool_arguments( method _post_process_completion_chunk (line 840) | def _post_process_completion_chunk( method _post_process_completion (line 922) | def _post_process_completion( method _transform_messages (line 1013) | def _transform_messages( method _async_to_tool_completion_chunks (line 1050) | async def _async_to_tool_completion_chunks( function get_model_version (line 1093) | def get_model_version( function _decode_image (line 1102) | def _decode_image(_url): function _decode_image_without_rgb (line 1121) | def _decode_image_without_rgb(_url): function generate_completion_chunk (line 1141) | def generate_completion_chunk( function generate_completion (line 1175) | def generate_completion( function generate_chat_completion (line 1201) | def generate_chat_completion( function get_stop_token_ids_from_config_file (line 1230) | def get_stop_token_ids_from_config_file(model_path: str) -> Optional[Lis... function normalize_response_format (line 1252) | def normalize_response_format( function parse_messages (line 1278) | def parse_messages(messages: List[Dict]) -> Tuple: FILE: xinference/model/llm/vllm/core.py class VLLMModelConfig (line 88) | class VLLMModelConfig(TypedDict, total=False): class VLLMGenerateConfig (line 117) | class VLLMGenerateConfig(TypedDict, total=False): function _get_effective_vllm_version (line 165) | def _get_effective_vllm_version() -> version.Version: function _virtual_env_allows_missing_vllm (line 177) | def _virtual_env_allows_missing_vllm() -> bool: function _append_unique (line 185) | def _append_unique(target: List[str], *items: str) -> None: function _update_vllm_supported_lists (line 209) | def _update_vllm_supported_lists() -> None: class VLLMModel (line 325) | class VLLMModel(LLM): method __init__ (line 328) | def __init__( method set_xavier_config (line 358) | def set_xavier_config(self, value: Optional[Dict]): method set_worker_addresses (line 361) | def set_worker_addresses(self, shard: int, worker_addresses: List[str]): method driver_info (line 371) | def driver_info(self) -> Optional[dict]: method need_create_pools (line 375) | def need_create_pools(self): method set_pool_addresses (line 378) | def set_pool_addresses(self, pool_addresses: List[str]): method get_pool_addresses (line 381) | def get_pool_addresses(self) -> Optional[List[str]]: method set_loop (line 384) | def set_loop(self, loop: asyncio.AbstractEventLoop): method _is_vllm_v1 (line 389) | def _is_vllm_v1(self) -> bool: method load (line 405) | def load(self): method wait_for_load (line 628) | def wait_for_load(self): method _set_context_length (line 640) | def _set_context_length(self): method _enable_v1_if_supported (line 652) | def _enable_v1_if_supported(self, engine_args: "vllm.AsyncEngineArgs"): method _preprocess_load_gguf (line 696) | def _preprocess_load_gguf(self): method stop (line 740) | def stop(self): method init_xavier (line 760) | async def init_xavier(self): method _check_healthy (line 763) | async def _check_healthy(self, interval: int = 30): method parse_str_field_to_dict (line 783) | def parse_str_field_to_dict( method _sanitize_model_config (line 828) | def _sanitize_model_config( method _sanitize_generate_config (line 891) | def _sanitize_generate_config( method check_lib (line 979) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 989) | def match_json( method _convert_request_output_to_completion_chunk (line 1031) | def _convert_request_output_to_completion_chunk( method _convert_request_output_to_completion (line 1058) | def _convert_request_output_to_completion( method _get_tokenizer (line 1090) | async def _get_tokenizer(self, lora_request: Any) -> Any: method _tokenize (line 1124) | def _tokenize(self, tokenizer: Any, prompt: str, config: dict) -> List... method _gen_tokens_prompt (line 1148) | async def _gen_tokens_prompt( method async_generate (line 1162) | async def async_generate( class VLLMChatModel (line 1532) | class VLLMChatModel(VLLMModel, ChatModelMixin): method match_json (line 1534) | def match_json( method _sanitize_chat_config (line 1580) | def _sanitize_chat_config( method is_tool_call_chunk_start (line 1616) | def is_tool_call_chunk_start(chunk): method is_tool_call_chunk_end (line 1620) | def is_tool_call_chunk_end(chunk): method prefill_messages (line 1624) | def prefill_messages(messages: List[Dict]) -> List[Dict]: method async_chat (line 1650) | async def async_chat( class VLLMMultiModel (line 1718) | class VLLMMultiModel(VLLMModel, ChatModelMixin): method match_json (line 1720) | def match_json( method _attach_video_metadata (line 1777) | def _attach_video_metadata( method _sanitize_model_config (line 1801) | def _sanitize_model_config( method _sanitize_chat_config (line 1842) | def _sanitize_chat_config( method _gen_tokens_prompt (line 1861) | async def _gen_tokens_prompt( method _handle_base64_images (line 1882) | def _handle_base64_images(self, messages, temp_files): method async_chat (line 1930) | async def async_chat( FILE: xinference/model/llm/vllm/distributed_executor.py class WorkerActor (line 45) | class WorkerActor(xo.StatelessActor): method __init__ (line 46) | def __init__(self, vllm_config: "VllmConfig", rpc_rank: int = 0, **kwa... method __post_create__ (line 50) | async def __post_create__(self): method __getattr__ (line 59) | def __getattr__(self, item): method gen_uid (line 63) | def gen_uid(cls, rank): method execute_method (line 66) | def execute_method(self, method: Union[str, Callable], *args, **kwargs): class WorkerWrapper (line 82) | class WorkerWrapper: method __init__ (line 83) | def __init__( method execute_method (line 91) | def execute_method(self, method: Union[str, Callable], *args, **kwargs): method execute_method_async (line 95) | async def execute_method_async(self, method: Union[str, Callable], *ar... method kill (line 98) | def kill(self): class XinferenceDistributedExecutor (line 103) | class XinferenceDistributedExecutor(DistributedExecutorBase): method __init__ (line 111) | def __init__( method _create_workers (line 126) | def _create_workers(self, refs: xo.ActorRefType[WorkerActor]) -> None: method _init_executor (line 142) | def _init_executor(self) -> None: method _run_workers (line 232) | def _run_workers( method _wait_for_tasks_completion (line 258) | def _wait_for_tasks_completion(self, parallel_worker_tasks: Any) -> None: method check_health (line 264) | def check_health(self) -> None: method shutdown (line 269) | def shutdown(self) -> None: method __del__ (line 282) | def __del__(self): method _driver_execute_model (line 285) | def _driver_execute_model( method _driver_execute_model_async (line 290) | async def _driver_execute_model_async( method _start_worker_execution_loop (line 334) | async def _start_worker_execution_loop(self): class XinferenceDistributedExecutorV1 (line 344) | class XinferenceDistributedExecutorV1(XinferenceDistributedExecutor, Exe... method __init__ (line 345) | def __init__( method _create_workers (line 363) | def _create_workers(self, refs: xo.ActorRefType[WorkerActor]) -> None: method execute_model (line 366) | def execute_model( method _run_workers (line 373) | def _run_workers( FILE: xinference/model/llm/vllm/distributed_executor_v1.py class WorkerActor (line 49) | class WorkerActor(xo.StatelessActor): method __init__ (line 50) | def __init__(self, vllm_config: "VllmConfig", rpc_rank: int = 0, **kwa... method __post_create__ (line 54) | async def __post_create__(self): method __getattr__ (line 63) | def __getattr__(self, item): method gen_uid (line 71) | def gen_uid(cls, rank): method execute_method (line 74) | def execute_method(self, method: Union[str, Callable], *args, **kwargs): method _sanitize_result (line 93) | def _sanitize_result(self, obj): class WorkerWrapper (line 98) | class WorkerWrapper: method __init__ (line 99) | def __init__( method execute_method (line 107) | def execute_method(self, method: Union[str, Callable], *args, **kwargs): method execute_method_async (line 111) | async def execute_method_async(self, method: Union[str, Callable], *ar... method kill (line 114) | def kill(self): class XinferenceDistributedExecutorV1 (line 119) | class XinferenceDistributedExecutorV1(Executor): method __init__ (line 126) | def __init__( method _init_executor (line 151) | def _init_executor(self) -> None: method collective_rpc (line 241) | def collective_rpc( method execute_model (line 251) | def execute_model( method check_health (line 259) | def check_health(self) -> None: method shutdown (line 264) | def shutdown(self) -> None: method _create_workers (line 277) | def _create_workers(self, refs: xo.ActorRefType[WorkerActor]) -> None: method _run_workers (line 280) | def _run_workers( FILE: xinference/model/llm/vllm/tests/test_core_chat_model.py function filter_ids_and_created (line 22) | def filter_ids_and_created(data): class TestVLLMChatModel (line 34) | class TestVLLMChatModel: method real_vllm_chat_model (line 37) | def real_vllm_chat_model(self): method create_mock_chunks (line 52) | async def create_mock_chunks(self, chunks_data): method test_async_to_tool_completion_chunks_without_thinking (line 57) | async def test_async_to_tool_completion_chunks_without_thinking( method test_async_to_tool_completion_chunks_with_thinking (line 484) | async def test_async_to_tool_completion_chunks_with_thinking( method test_async_to_tool_completion_chunks_with_parser (line 942) | async def test_async_to_tool_completion_chunks_with_parser( FILE: xinference/model/llm/vllm/tests/test_distributed_executor.py function actor_pool_context (line 33) | async def actor_pool_context(): function test_distributed_executor (line 43) | async def test_distributed_executor(actor_pool_context): FILE: xinference/model/llm/vllm/utils.py function vllm_check (line 22) | def vllm_check(fn): function get_distributed_init_method (line 45) | def get_distributed_init_method(ip: str, port: int) -> str: function get_tcp_uri (line 49) | def get_tcp_uri(ip: str, port: int) -> str: function is_valid_ipv6_address (line 56) | def is_valid_ipv6_address(address: str) -> bool: FILE: xinference/model/llm/vllm/xavier/allocator.py class XavierCpuGpuBlockAllocator (line 24) | class XavierCpuGpuBlockAllocator(CpuGpuBlockAllocator): method __init__ (line 25) | def __init__(self, *args, **kwargs): method xavier_config (line 30) | def xavier_config(self): method xavier_config (line 34) | def xavier_config(self, v: Dict[str, Any]): method create (line 39) | def create( FILE: xinference/model/llm/vllm/xavier/block.py class XavierInnerBlockTracker (line 30) | class XavierInnerBlockTracker(BlockTracker): method __init__ (line 44) | def __init__(self): class XavierPrefixCachingBlockAllocator (line 50) | class XavierPrefixCachingBlockAllocator(PrefixCachingBlockAllocator): method __init__ (line 51) | def __init__(self, *args, run_isolation: bool = False, **kwargs): method __del__ (line 66) | def __del__(self): method xavier_config (line 71) | def xavier_config(self): method xavier_config (line 75) | def xavier_config(self, v: Dict[str, Any]): method _get_block_tracker_ref (line 78) | async def _get_block_tracker_ref(self): method unregister_block (line 87) | async def unregister_block(self, block_id: int): method _maybe_allocate_evicted_block_id (line 96) | def _maybe_allocate_evicted_block_id(self) -> Optional[BlockId]: FILE: xinference/model/llm/vllm/xavier/block_manager.py class XavierBlockManager (line 28) | class XavierBlockManager(SelfAttnBlockSpaceManager): method __init__ (line 29) | def __init__(self, *args, **kwargs): method xavier_config (line 37) | def xavier_config(self): method xavier_config (line 41) | def xavier_config(self, value: Dict[str, Any]): method get_block_by_block_id (line 45) | def get_block_by_block_id(self, seq_id: int, block_id: int) -> Block: method get_block_status_by_block_id (line 51) | def get_block_status_by_block_id(self, status_name: str, block_id: int... method set_block_status_by_block_id (line 55) | def set_block_status_by_block_id( method allocate (line 62) | def allocate(self, seq_group: SequenceGroup) -> None: FILE: xinference/model/llm/vllm/xavier/block_tracker.py class VLLMBlockTracker (line 20) | class VLLMBlockTracker(xo.StatelessActor): method default_uid (line 22) | def default_uid(cls): method __init__ (line 25) | def __init__(self): method register_blocks (line 33) | def register_blocks( method query_blocks (line 56) | def query_blocks( method unregister_block (line 85) | def unregister_block(self, virtual_engine: int, rank: int, block_id: i... method unregister_rank (line 110) | def unregister_rank(self, rank: int): method register_rank (line 116) | def register_rank(self, rank: int): FILE: xinference/model/llm/vllm/xavier/collective.py class CollectiveRank (line 20) | class CollectiveRank: method __init__ (line 21) | def __init__( method init_rank (line 40) | def init_rank(self): method connect_full_mesh (line 58) | def connect_full_mesh( FILE: xinference/model/llm/vllm/xavier/collective_manager.py class Rank0ModelActor (line 30) | class Rank0ModelActor(xo.StatelessActor): method default_uid (line 32) | def default_uid(cls): method __init__ (line 35) | def __init__(self, xavier_config: Dict[str, Any]): method __pre_destroy__ (line 41) | async def __pre_destroy__(self): method start_transfer_for_vllm (line 52) | async def start_transfer_for_vllm(self, rank_addresses: List[str]): function with_lock (line 71) | def with_lock(method): class CollectiveManager (line 79) | class CollectiveManager(xo.StatelessActor): method default_uid (line 81) | def default_uid(cls): method __init__ (line 84) | def __init__(self, model_uid: str): method __post_create__ (line 91) | async def __post_create__(self): method unregister_rank (line 97) | async def unregister_rank(self, rank: int): method register_rank (line 102) | async def register_rank(self, rank: int, address: str, update: bool = ... method _update_world (line 115) | async def _update_world(self): FILE: xinference/model/llm/vllm/xavier/engine.py class XavierInternalEngine (line 34) | class XavierInternalEngine(_AsyncLLMEngine): method __init__ (line 35) | def __init__(self, *args, **kwargs): method step_async (line 57) | async def step_async( class XavierEngine (line 220) | class XavierEngine(AsyncLLMEngine): method _get_executor_cls (line 225) | def _get_executor_cls(cls, engine_config: VllmConfig) -> Type[Executor... method from_engine_args (line 230) | def from_engine_args( method __init__ (line 253) | def __init__(self, *args, **kwargs): method init_xavier (line 259) | async def init_xavier(self): FILE: xinference/model/llm/vllm/xavier/executor.py class XavierExecutor (line 29) | class XavierExecutor(MultiprocessingDistributedExecutor): method _init_executor (line 34) | def _init_executor(self) -> None: method init_transfer (line 39) | async def init_transfer(self): method _get_block_tracker_ref (line 70) | async def _get_block_tracker_ref(self): method _get_transfer_ref (line 81) | async def _get_transfer_ref(self): method get_rank (line 92) | def get_rank(self) -> int: method execute_model_async (line 95) | async def execute_model_async( FILE: xinference/model/llm/vllm/xavier/scheduler.py class XavierScheduler (line 40) | class XavierScheduler(Scheduler): method _get_block_space_manager_class (line 45) | def _get_block_space_manager_class(version: str): method __init__ (line 49) | def __init__( method _get_block_tracker_ref (line 78) | async def _get_block_tracker_ref(self): method _get_transfer_ref (line 87) | async def _get_transfer_ref(self): method _get_transfer_details (line 98) | async def _get_transfer_details( method _do_transfer_inner (line 181) | async def _do_transfer_inner( method _do_transfer (line 189) | async def _do_transfer( method schedule (line 222) | async def schedule( method has_unfinished_seqs (line 453) | def has_unfinished_seqs(self) -> bool: method get_num_unfinished_seq_groups (line 461) | def get_num_unfinished_seq_groups(self) -> int: FILE: xinference/model/llm/vllm/xavier/test/test_xavier.py class ExtendedBlockTracker (line 21) | class ExtendedBlockTracker(VLLMBlockTracker): method get_hash_to_rank_and_block_id (line 22) | def get_hash_to_rank_and_block_id(self): method get_rank_to_hash_and_block_id (line 25) | def get_rank_to_hash_and_block_id(self): function actor_pool_context (line 30) | async def actor_pool_context(): function test_block_tracker (line 37) | async def test_block_tracker(actor_pool_context): FILE: xinference/model/llm/vllm/xavier/transfer.py class BufferTransferMixin (line 31) | class BufferTransferMixin: method __init__ (line 32) | def __init__(self): method init_buffer (line 39) | def init_buffer( method get_buffer_index (line 73) | def get_buffer_index(self) -> int: method free_buffer_index (line 77) | def free_buffer_index(self, index: int) -> None: method get_swap_buffer (line 80) | def get_swap_buffer(self, index: int, num_blocks: int) -> torch.Tensor: method get_gloo_dtype (line 88) | def get_gloo_dtype(self, input_dtype: torch.dtype): class TransferActor (line 94) | class TransferActor(xo.StatelessActor, BufferTransferMixin, CollectiveRa... method default_uid (line 96) | def default_uid(cls): method __init__ (line 99) | def __init__( method __post_create__ (line 122) | async def __post_create__(self): method setup (line 125) | def setup( method __pre_destroy__ (line 141) | async def __pre_destroy__(self): method _get_cache_engine (line 144) | def _get_cache_engine(self, virtual_engine: int) -> CacheEngine: method _get_swap_block_ids (line 148) | def _get_swap_block_ids(src_to_dst: Dict[int, int], is_sender: bool) -... method _swap_out_to_buffer (line 151) | def _swap_out_to_buffer( method _swap_in_from_buffer (line 169) | def _swap_in_from_buffer( method _incr_count_for_block_id (line 184) | def _incr_count_for_block_id(self, virtual_engine: int, block_ids: Lis... method _decr_count_for_block_id (line 195) | def _decr_count_for_block_id(self, virtual_engine: int, block_ids: Lis... method do_send (line 205) | async def do_send( method do_recv (line 238) | async def do_recv( method recv (line 271) | async def recv( class Rank0TransferActor (line 289) | class Rank0TransferActor(xo.StatelessActor, CollectiveRank): method default_uid (line 296) | def default_uid(cls): method __init__ (line 299) | def __init__( method __post_create__ (line 318) | async def __post_create__(self): FILE: xinference/model/llm/vllm/xavier/utils.py function hash_block_tokens (line 20) | def hash_block_tokens( FILE: xinference/model/rerank/__init__.py function register_builtin_model (line 45) | def register_builtin_model(): function register_custom_model (line 50) | def register_custom_model(): function check_format_with_engine (line 72) | def check_format_with_engine(model_format, engine): function generate_engine_config_by_model_name (line 80) | def generate_engine_config_by_model_name(model_family: "RerankModelFamil... function has_downloaded_models (line 118) | def has_downloaded_models(): function load_downloaded_models (line 125) | def load_downloaded_models(): function load_model_family_from_json (line 140) | def load_model_family_from_json(json_filename, target_families): function _install (line 162) | def _install(): FILE: xinference/model/rerank/cache_manager.py class RerankCacheManager (line 10) | class RerankCacheManager(CacheManager): method __init__ (line 11) | def __init__(self, model_family: "RerankModelFamilyV2"): method cache (line 25) | def cache(self) -> str: FILE: xinference/model/rerank/core.py function get_rerank_model_descriptions (line 39) | def get_rerank_model_descriptions(): class TransformersRerankSpecV1 (line 45) | class TransformersRerankSpecV1(BaseModel): class LlamaCppRerankSpecV1 (line 54) | class LlamaCppRerankSpecV1(BaseModel): class RerankModelFamilyV2 (line 72) | class RerankModelFamilyV2(BaseModel, ModelInstanceInfoMixin): class Config (line 82) | class Config: method to_description (line 85) | def to_description(self): method to_version_info (line 97) | def to_version_info(self): function generate_rerank_description (line 109) | def generate_rerank_description( class RerankModel (line 117) | class RerankModel: method __init__ (line 118) | def __init__( method check_lib (line 144) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 149) | def match_json( method match (line 158) | def match( method _get_tokenizer (line 174) | def _get_tokenizer(model_path): method _auto_detect_type (line 181) | def _auto_detect_type(model_path): method load (line 201) | def load(self): ... method rerank (line 204) | def rerank( function create_rerank_model_instance (line 216) | def create_rerank_model_instance( FILE: xinference/model/rerank/custom.py class CustomRerankModelFamilyV2 (line 23) | class CustomRerankModelFamilyV2(RerankModelFamilyV2): class RerankModelRegistry (line 30) | class RerankModelRegistry(ModelRegistry): method __init__ (line 33) | def __init__(self): method add_ud_model (line 40) | def add_ud_model(self, model_spec): method check_model_uri (line 46) | def check_model_uri(self, model_family: "RerankModelFamilyV2"): method remove_ud_model (line 54) | def remove_ud_model(self, model_family: "CustomRerankModelFamilyV2"): method remove_ud_model_files (line 60) | def remove_ud_model_files(self, model_family: "CustomRerankModelFamily... function get_user_defined_reranks (line 70) | def get_user_defined_reranks() -> List[CustomRerankModelFamilyV2]: function register_rerank (line 77) | def register_rerank(model_family: CustomRerankModelFamilyV2, persist: bo... function unregister_rerank (line 84) | def unregister_rerank(model_name: str, raise_error: bool = True): FILE: xinference/model/rerank/llama_cpp/core.py class _Done (line 33) | class _Done: class _Error (line 37) | class _Error: method __init__ (line 38) | def __init__(self, msg): class XllamaCppRerankModel (line 42) | class XllamaCppRerankModel(RerankModel): method __init__ (line 43) | def __init__(self, *args, **kwargs) -> None: method _sanitize_model_config (line 50) | def _sanitize_model_config(self, llamacpp_model_config: Optional[dict]... method _is_darwin_and_apple_silicon (line 65) | def _is_darwin_and_apple_silicon(self): method _is_linux (line 68) | def _is_linux(self): method load (line 71) | def load(self): method rerank (line 193) | def rerank( method check_lib (line 233) | def check_lib(cls) -> bool: method match_json (line 237) | def match_json( FILE: xinference/model/rerank/llama_cpp/tests/test_llama_cpp.py function test_rerank_model_with_xllamacpp (line 40) | def test_rerank_model_with_xllamacpp(): FILE: xinference/model/rerank/rerank_family.py function match_rerank (line 31) | def match_rerank( function check_engine_by_model_name_and_engine (line 117) | def check_engine_by_model_name_and_engine( function check_engine_by_model_name_and_engine_with_virtual_env (line 146) | def check_engine_by_model_name_and_engine_with_virtual_env( FILE: xinference/model/rerank/sentence_transformers/core.py class _ModelWrapper (line 45) | class _ModelWrapper(nn.Module): method __init__ (line 46) | def __init__(self, module: nn.Module): method n_tokens (line 52) | def n_tokens(self): method n_tokens (line 56) | def n_tokens(self, value): method input_tokens (line 60) | def input_tokens(self): method input_tokens (line 66) | def input_tokens(self, value): method input_ids (line 70) | def input_ids(self): method input_ids (line 76) | def input_ids(self, value): method forward (line 79) | def forward(self, **kwargs): method __getattr__ (line 92) | def __getattr__(self, attr): class SentenceTransformerRerankModel (line 99) | class SentenceTransformerRerankModel(RerankModel, BatchMixin): method __init__ (line 100) | def __init__(self, *args, **kwargs) -> None: method load (line 105) | def load(self): method _rerank (line 273) | def _rerank( method _normalize_vl_text (line 364) | def _normalize_vl_text(self, val: Any) -> Dict[str, Any]: method _rerank_vl (line 371) | def _rerank_vl(self, documents: List[Any], query: List[Any], **kwargs)... method rerank (line 396) | def rerank( method rerank (line 468) | def rerank(self, args_list, kwargs_list): method _extract_rerank_kwargs (line 597) | def _extract_rerank_kwargs(self, args, kwargs): method _get_batch_size (line 639) | def _get_batch_size(self, *args, **kwargs) -> int: method flag_engine_match_query_doc (line 647) | def flag_engine_match_query_doc(prompt: str, query: str, doc: str) -> ... method check_lib (line 681) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 685) | def match_json( FILE: xinference/model/rerank/sentence_transformers/tests/test_sentence_transformers.py function test_model (line 23) | async def test_model(): FILE: xinference/model/rerank/tests/test_qwen3_vl_reranker_virtualenv.py function _get_cached_model_path (line 32) | def _get_cached_model_path(): function _get_virtualenv_site_packages (line 38) | def _get_virtualenv_site_packages(env_path: str) -> str: function _purge_modules (line 45) | def _purge_modules(prefixes): function _prepare_engine_virtualenv (line 51) | def _prepare_engine_virtualenv(engine_name: str, virtual_env_packages=No... function test_qwen3_vl_reranker_sentence_transformers_startup_virtualenv (line 83) | def test_qwen3_vl_reranker_sentence_transformers_startup_virtualenv(): FILE: xinference/model/rerank/tests/test_rerank.py function test_restful_api (line 27) | def test_restful_api(model_name, model_engine, setup): function test_from_local_uri (line 97) | def test_from_local_uri(): function test_register_custom_rerank (line 125) | def test_register_custom_rerank(): function test_auto_detect_type (line 201) | def test_auto_detect_type(): FILE: xinference/model/rerank/utils.py function get_model_version (line 20) | def get_model_version(rerank_model: "RerankModelFamilyV2") -> str: function preprocess_sentence (line 29) | def preprocess_sentence(query: str, instruction: Any, model_name: str) -... FILE: xinference/model/rerank/vllm/core.py class VLLMRerankModel (line 26) | class VLLMRerankModel(RerankModel, BatchMixin): method __init__ (line 27) | def __init__(self, *args, **kwargs) -> None: method load (line 31) | def load(self): method _rerank (line 74) | def _rerank( method rerank (line 152) | def rerank( method rerank (line 217) | def rerank(self, args_list, kwargs_list): method _extract_rerank_kwargs (line 300) | def _extract_rerank_kwargs(self, args, kwargs): method _get_batch_size (line 342) | def _get_batch_size(self, *args, **kwargs) -> int: method stop (line 349) | def stop(self): method check_lib (line 367) | def check_lib(cls) -> Union[bool, Tuple[bool, str]]: method match_json (line 374) | def match_json( FILE: xinference/model/rerank/vllm/tests/test_vllm.py function test_model (line 27) | def test_model(): function test_qwen3_vllm (line 57) | def test_qwen3_vllm(setup): FILE: xinference/model/scheduler/batch.py class BatchScheduler (line 32) | class BatchScheduler: method __init__ (line 33) | def __init__(self, model): method start (line 42) | async def start(self): method stop (line 49) | async def stop(self): method get_max_num_seqs (line 60) | def get_max_num_seqs(self): method _check_request_aborted (line 64) | def _check_request_aborted(self, req: InferenceRequest): method _handle_request (line 69) | def _handle_request(self) -> Optional[List[InferenceRequest]]: method _empty_cache (line 94) | def _empty_cache(): method step (line 100) | async def step(self): method add_request (line 161) | async def add_request( method abort_request (line 179) | async def abort_request(self, req_id: str) -> str: method _run (line 192) | async def _run(self): FILE: xinference/model/scheduler/core.py class AbortRequestMessage (line 18) | class AbortRequestMessage(Enum): FILE: xinference/model/scheduler/request.py class InferenceRequest (line 20) | class InferenceRequest: method __init__ (line 21) | def __init__( method _check_args (line 89) | def _check_args(self): method prompt (line 97) | def prompt(self): method prompt (line 104) | def prompt(self, value: str): method call_ability (line 108) | def call_ability(self): method full_prompt (line 112) | def full_prompt(self): method full_prompt (line 116) | def full_prompt(self, value: str): method is_prefill (line 120) | def is_prefill(self): method is_prefill (line 124) | def is_prefill(self, value: bool): method prompt_tokens (line 128) | def prompt_tokens(self): method prompt_tokens (line 132) | def prompt_tokens(self, value: List[int]): method kv_cache (line 136) | def kv_cache(self): method kv_cache (line 140) | def kv_cache(self, value): method new_tokens (line 144) | def new_tokens(self): method append_new_token (line 147) | def append_new_token(self, token: int): method generate_config (line 151) | def generate_config(self): method sanitized_generate_config (line 155) | def sanitized_generate_config(self): method sanitized_generate_config (line 159) | def sanitized_generate_config(self, value: dict): method inference_kwargs (line 163) | def inference_kwargs(self): method stopped (line 167) | def stopped(self): method stopped (line 171) | def stopped(self, value: bool): method finish_reason (line 175) | def finish_reason(self): method finish_reason (line 179) | def finish_reason(self, value: Optional[str]): method chunk_id (line 183) | def chunk_id(self): method stream (line 187) | def stream(self) -> bool: method stream_interval (line 195) | def stream_interval(self) -> int: method include_usage (line 199) | def include_usage(self) -> bool: method aborted (line 209) | def aborted(self) -> bool: method aborted (line 213) | def aborted(self, value: bool): method request_id (line 217) | def request_id(self) -> Optional[str]: method get_generate_configs (line 225) | def get_generate_configs( FILE: xinference/model/tests/test_utils.py function test_parse_uri (line 33) | def test_parse_uri(): function test_tqdm_patch (line 51) | def test_tqdm_patch(): function test_extract_engine_markers_from_packages (line 78) | def test_extract_engine_markers_from_packages(): function test_collect_virtualenv_engine_markers_platform_gating (line 87) | def test_collect_virtualenv_engine_markers_platform_gating(): class _DummyEngineMissing (line 103) | class _DummyEngineMissing: method check_lib (line 105) | def check_lib(): class _DummyEngineOk (line 109) | class _DummyEngineOk: method check_lib (line 111) | def check_lib(): class _DummyEngineMatchJson (line 115) | class _DummyEngineMatchJson: method match_json (line 117) | def match_json(family, spec, quantization): function test_force_virtualenv_engine_params_and_override (line 121) | def test_force_virtualenv_engine_params_and_override(): function test_virtualenv_override_disabled_marks_unavailable (line 148) | def test_virtualenv_override_disabled_marks_unavailable(): function test_download_hugginface (line 159) | async def test_download_hugginface(): function test_download_modelscope (line 216) | async def test_download_modelscope(): function test_cancel (line 273) | async def test_cancel(): FILE: xinference/model/utils.py function _normalize_match_result (line 69) | def _normalize_match_result( function _extract_engine_markers_from_packages (line 98) | def _extract_engine_markers_from_packages(packages: List[str]) -> Set[str]: function _collect_virtualenv_engine_markers (line 106) | def _collect_virtualenv_engine_markers(family: Optional[Any]) -> Set[str]: function _build_engine_params_from_specs (line 136) | def _build_engine_params_from_specs( function _build_engine_params_from_specs_by_quantization (line 172) | def _build_engine_params_from_specs_by_quantization( function _force_virtualenv_engine_params (line 206) | def _force_virtualenv_engine_params( function _apply_virtualenv_engine_overrides (line 327) | def _apply_virtualenv_engine_overrides( function check_dependency_available (line 384) | def check_dependency_available( function is_locale_chinese_simplified (line 402) | def is_locale_chinese_simplified() -> bool: function download_from_modelscope (line 412) | def download_from_modelscope() -> bool: function download_from_openmind_hub (line 421) | def download_from_openmind_hub() -> bool: function download_from_csghub (line 428) | def download_from_csghub() -> bool: function symlink_local_file (line 434) | def symlink_local_file(path: str, local_dir: str, relpath: str) -> str: function create_symlink (line 462) | def create_symlink(download_dir: str, cache_dir: str): function retry_download (line 469) | def retry_download( function valid_model_revision (line 513) | def valid_model_revision( function get_cache_dir (line 545) | def get_cache_dir(model_spec: Any) -> str: function is_model_cached (line 549) | def is_model_cached(model_spec: Any, name_to_revisions_mapping: Dict): function is_valid_model_name (line 558) | def is_valid_model_name(model_name: str) -> bool: function parse_uri (line 568) | def parse_uri(uri: str) -> Tuple[str, str]: function is_valid_model_uri (line 583) | def is_valid_model_uri(model_uri: Optional[str]) -> bool: function cache_from_uri (line 598) | def cache_from_uri(model_spec: CacheableModelSpec) -> str: function select_device (line 624) | def select_device(device): function convert_float_to_int_or_str (line 641) | def convert_float_to_int_or_str(model_size: float) -> Union[int, str]: function set_all_random_seed (line 652) | def set_all_random_seed(seed: int): class CancellableDownloader (line 659) | class CancellableDownloader: method __init__ (line 666) | def __init__( method reset (line 684) | def reset(self): method get_progress (line 688) | def get_progress(self) -> float: method cancel (line 725) | def cancel(self): method cancelled (line 730) | def cancelled(self): method done (line 734) | def done(self): method wait (line 737) | def wait(self, timeout: float): method raise_error (line 740) | def raise_error(self, error_msg: str = "Download cancelled"): method patch_tqdm (line 743) | def patch_tqdm(self): method unpatch_tqdm (line 795) | def unpatch_tqdm(self): method __enter__ (line 806) | def __enter__(self): method __exit__ (line 814) | def __exit__(self, exc_type, exc_val, exc_tb): function get_engine_params_by_name (line 828) | def get_engine_params_by_name( function get_engine_params_by_name_with_virtual_env (line 1205) | def get_engine_params_by_name_with_virtual_env( function generate_model_file_names_with_quantization_parts (line 1690) | def generate_model_file_names_with_quantization_parts( function merge_cached_files (line 1732) | def merge_cached_files( function flatten_model_src (line 1745) | def flatten_model_src(input_json: dict): function flatten_quantizations (line 1776) | def flatten_quantizations(input_json: dict): class ModelInstanceInfoMixin (line 1802) | class ModelInstanceInfoMixin(ABC): method to_description (line 1804) | def to_description(self): method to_version_info (line 1808) | def to_version_info(self): function is_flash_attn_available (line 1812) | def is_flash_attn_available() -> bool: function cache_clean (line 1875) | def cache_clean(fn): function load_downloaded_models_to_dict (line 1906) | def load_downloaded_models_to_dict( function merge_models_by_timestamp (line 1932) | def merge_models_by_timestamp( function install_models_with_merge (line 1986) | def install_models_with_merge( FILE: xinference/model/video/__init__.py function register_custom_model (line 31) | def register_custom_model(): class CustomVideoModelFamilyV2 (line 38) | class CustomVideoModelFamilyV2(VideoModelFamilyV2): function register_video (line 44) | def register_video(model_family, persist=True): function unregister_video (line 50) | def unregister_video(model_name, version=None): function register_builtin_model (line 56) | def register_builtin_model(): function _install (line 61) | def _install(): function has_downloaded_models (line 82) | def has_downloaded_models(): function load_downloaded_models (line 89) | def load_downloaded_models(): function load_model_family_from_json (line 104) | def load_model_family_from_json(json_filename, target_families): FILE: xinference/model/video/cache_manager.py class VideoCacheManager (line 7) | class VideoCacheManager(CacheManager): method cache_gguf (line 8) | def cache_gguf(self, quantization: Optional[str] = None): FILE: xinference/model/video/core.py function get_video_model_descriptions (line 28) | def get_video_model_descriptions(): class VideoModelFamilyV2 (line 34) | class VideoModelFamilyV2(CacheableModelSpec, ModelInstanceInfoMixin): class Config (line 49) | class Config: method to_description (line 52) | def to_description(self): method to_version_info (line 63) | def to_version_info(self): function generate_video_description (line 75) | def generate_video_description( function match_diffusion (line 83) | def match_diffusion( function create_video_model_instance (line 108) | def create_video_model_instance( FILE: xinference/model/video/diffusers.py function export_to_video_imageio (line 42) | def export_to_video_imageio( class DiffusersVideoModel (line 60) | class DiffusersVideoModel: method __init__ (line 61) | def __init__( method model_spec (line 79) | def model_spec(self): method model_ability (line 83) | def model_ability(self): method _get_layer_cls (line 86) | def _get_layer_cls(self, layer: str): method _load_transformer_gguf (line 94) | def _load_transformer_gguf(self, torch_dtype): method _register_transformer (line 106) | def _register_transformer(pipeline, transformer): method load (line 114) | def load(self): method _process_progressor (line 257) | def _process_progressor(kwargs: dict): method text_to_video (line 276) | def text_to_video( method image_to_video (line 302) | def image_to_video( method firstlastframe_to_video (line 336) | def firstlastframe_to_video( method _process_image (line 378) | def _process_image(self, image: PIL.Image.Image, max_area: int) -> PIL... method _center_crop_resize (line 390) | def _center_crop_resize( method _output_to_video (line 406) | def _output_to_video(self, output: Any, fps: int, response_format: str): FILE: xinference/model/video/tests/test_diffusers_video.py function test_model (line 26) | def test_model(): function test_client (line 38) | def test_client(setup): FILE: xinference/thirdparty/audiotools/core/audio_signal.py class AudioSignal (line 53) | class AudioSignal( method __init__ (line 122) | def __init__( method path_to_input_file (line 170) | def path_to_input_file( method excerpt (line 180) | def excerpt( method salient_excerpt (line 228) | def salient_excerpt( method zeros (line 289) | def zeros( method wave (line 327) | def wave( method batch (line 381) | def batch( method load_from_file (line 473) | def load_from_file( method load_from_array (line 526) | def load_from_array( method write (line 566) | def write(self, audio_path: typing.Union[str, Path]): method deepcopy (line 607) | def deepcopy(self): method copy (line 617) | def copy(self): method clone (line 627) | def clone(self): method detach (line 654) | def detach(self): method hash (line 673) | def hash(self): method to_mono (line 704) | def to_mono(self): method resample (line 716) | def resample(self, sample_rate: int): method to (line 739) | def to(self, device: str): method float (line 761) | def float(self): method cpu (line 771) | def cpu(self): method cuda (line 780) | def cuda(self): # pragma: no cover method numpy (line 789) | def numpy(self): method zero_pad (line 799) | def zero_pad(self, before: int, after: int): method zero_pad_to (line 817) | def zero_pad_to(self, length: int, mode: str = "after"): method trim (line 839) | def trim(self, before: int, after: int): method truncate_samples (line 860) | def truncate_samples(self, length_in_samples: int): method device (line 877) | def device(self): method audio_data (line 893) | def audio_data(self): method audio_data (line 914) | def audio_data(self, data: typing.Union[torch.Tensor, np.ndarray]): method stft_data (line 927) | def stft_data(self): method stft_data (line 939) | def stft_data(self, data: typing.Union[torch.Tensor, np.ndarray]): method batch_size (line 948) | def batch_size(self): method signal_length (line 959) | def signal_length(self): method shape (line 973) | def shape(self): method signal_duration (line 984) | def signal_duration(self): method num_channels (line 998) | def num_channels(self): method get_window (line 1011) | def get_window(window_type: str, window_length: int, device: str): method stft_params (line 1042) | def stft_params(self): method stft_params (line 1065) | def stft_params(self, value: STFTParams): method compute_stft_padding (line 1089) | def compute_stft_padding( method stft (line 1123) | def stft( method istft (line 1214) | def istft( method get_mel_filters (line 1300) | def get_mel_filters( method mel_spectrogram (line 1333) | def mel_spectrogram( method get_dct (line 1373) | def get_dct(n_mfcc: int, n_mels: int, norm: str = "ortho", device: str... method mfcc (line 1398) | def mfcc( method magnitude (line 1429) | def magnitude(self): method magnitude (line 1453) | def magnitude(self, value): method log_magnitude (line 1457) | def log_magnitude( method phase (line 1490) | def phase(self): method phase (line 1514) | def phase(self, value): method __add__ (line 1519) | def __add__(self, other): method __iadd__ (line 1524) | def __iadd__(self, other): method __radd__ (line 1528) | def __radd__(self, other): method __sub__ (line 1531) | def __sub__(self, other): method __isub__ (line 1536) | def __isub__(self, other): method __mul__ (line 1540) | def __mul__(self, other): method __imul__ (line 1545) | def __imul__(self, other): method __rmul__ (line 1549) | def __rmul__(self, other): method _info (line 1553) | def _info(self): method markdown (line 1568) | def markdown(self): method __str__ (line 1599) | def __str__(self): method __rich__ (line 1607) | def __rich__(self): method __eq__ (line 1621) | def __eq__(self, other): method __getitem__ (line 1631) | def __getitem__(self, key): method __setitem__ (line 1658) | def __setitem__(self, key, value): method __ne__ (line 1681) | def __ne__(self, other): FILE: xinference/thirdparty/audiotools/core/display.py function format_figure (line 8) | def format_figure(func): class DisplayMixin (line 33) | class DisplayMixin: method specshow (line 35) | def specshow( method waveplot (line 87) | def waveplot(self, x_axis: str = "time", **kwargs): method wavespec (line 108) | def wavespec(self, x_axis: str = "time", **kwargs): method write_audio_to_tb (line 127) | def write_audio_to_tb( method save_image (line 167) | def save_image( FILE: xinference/thirdparty/audiotools/core/dsp.py class DSPMixin (line 10) | class DSPMixin: method _preprocess_signal_for_windowing (line 15) | def _preprocess_signal_for_windowing(self, window_duration, hop_durati... method windows (line 31) | def windows( method collect_windows (line 70) | def collect_windows( method overlap_and_add (line 110) | def overlap_and_add(self, hop_duration: float): method low_pass (line 153) | def low_pass( method high_pass (line 185) | def high_pass( method mask_frequencies (line 217) | def mask_frequencies( method mask_timesteps (line 262) | def mask_timesteps( method mask_low_magnitudes (line 307) | def mask_low_magnitudes( method shift_phase (line 336) | def shift_phase(self, shift: typing.Union[torch.Tensor, np.ndarray, fl... method corrupt_phase (line 354) | def corrupt_phase(self, scale: typing.Union[torch.Tensor, np.ndarray, ... method preemphasis (line 372) | def preemphasis(self, coef: float = 0.85): FILE: xinference/thirdparty/audiotools/core/effects.py class EffectMixin (line 11) | class EffectMixin: method mix (line 27) | def mix( method convolve (line 66) | def convolve(self, other, start_at_max: bool = True): method apply_ir (line 125) | def apply_ir( method ensure_max_of_audio (line 181) | def ensure_max_of_audio(self, max: float = 1.0): method normalize (line 200) | def normalize(self, db: typing.Union[torch.Tensor, np.ndarray, float] ... method volume_change (line 222) | def volume_change(self, db: typing.Union[torch.Tensor, np.ndarray, flo... method _to_2d (line 240) | def _to_2d(self): method _to_3d (line 244) | def _to_3d(self, waveform): method pitch_shift (line 247) | def pitch_shift(self, n_semitones: int, quick: bool = True): method time_stretch (line 279) | def time_stretch(self, factor: float, quick: bool = True): method apply_codec (line 311) | def apply_codec( method mel_filterbank (line 386) | def mel_filterbank(self, n_bands: int): method equalizer (line 405) | def equalizer(self, db: typing.Union[torch.Tensor, np.ndarray]): method clip_distortion (line 435) | def clip_distortion( method quantization (line 463) | def quantization( method mulaw_quantization (line 492) | def mulaw_quantization( method __matmul__ (line 525) | def __matmul__(self, other): class ImpulseResponseMixin (line 529) | class ImpulseResponseMixin: method decompose_ir (line 540) | def decompose_ir(self): method measure_drr (line 576) | def measure_drr(self): method solve_alpha (line 592) | def solve_alpha(early_response, late_field, wd, target_drr): method alter_drr (line 617) | def alter_drr(self, drr: typing.Union[torch.Tensor, np.ndarray, float]): FILE: xinference/thirdparty/audiotools/core/ffmpeg.py function r128stats (line 13) | def r128stats(filepath: str, quiet: bool): function ffprobe_offset_and_codec (line 65) | def ffprobe_offset_and_codec(path: str) -> Tuple[float, str]: class FFMPEGMixin (line 87) | class FFMPEGMixin: method ffmpeg_loudness (line 90) | def ffmpeg_loudness(self, quiet: bool = True): method ffmpeg_resample (line 116) | def ffmpeg_resample(self, sample_rate: int, quiet: bool = True): method load_from_file_with_ffmpeg (line 150) | def load_from_file_with_ffmpeg(cls, audio_path: str, quiet: bool = Tru... FILE: xinference/thirdparty/audiotools/core/loudness.py class Meter (line 11) | class Meter(torch.nn.Module): method __init__ (line 34) | def __init__( method apply_filter_gpu (line 69) | def apply_filter_gpu(self, data: torch.Tensor): method apply_filter_cpu (line 102) | def apply_filter_cpu(self, data: torch.Tensor): method apply_filter (line 128) | def apply_filter(self, data: torch.Tensor): method forward (line 149) | def forward(self, data: torch.Tensor): method _unfold (line 164) | def _unfold(self, input_data): method integrated_loudness (line 176) | def integrated_loudness(self, data: torch.Tensor): method filter_class (line 250) | def filter_class(self): method filter_class (line 254) | def filter_class(self, value): class LoudnessMixin (line 263) | class LoudnessMixin: method loudness (line 268) | def loudness( FILE: xinference/thirdparty/audiotools/core/playback.py function _check_imports (line 25) | def _check_imports(): # pragma: no cover class PlayMixin (line 38) | class PlayMixin: method embed (line 39) | def embed(self, ext: str = None, display: bool = True, return_html: bo... method widget (line 96) | def widget( method play (line 192) | def play(self): FILE: xinference/thirdparty/audiotools/core/util.py class Info (line 22) | class Info: method duration (line 29) | def duration(self) -> float: function info (line 33) | def info(audio_path: str): function ensure_tensor (line 56) | def ensure_tensor( function _get_value (line 92) | def _get_value(other): function hz_to_bin (line 100) | def hz_to_bin(hz: torch.Tensor, n_fft: int, sample_rate: int): function random_state (line 129) | def random_state(seed: typing.Union[int, np.random.RandomState]): function seed (line 163) | def seed(random_seed, set_cudnn=False): function _close_temp_files (line 192) | def _close_temp_files(tmpfiles: list): function find_audio (line 225) | def find_audio(folder: str, ext: List[str] = AUDIO_EXTENSIONS): function read_sources (line 254) | def read_sources( function choose_from_list_of_lists (line 302) | def choose_from_list_of_lists( function chdir (line 327) | def chdir(newdir: typing.Union[Path, str]): function prepare_batch (line 346) | def prepare_batch(batch: typing.Union[dict, list, torch.Tensor], device:... function sample_from_dist (line 383) | def sample_from_dist(dist_tuple: tuple, state: np.random.RandomState = N... function collate (line 426) | def collate(list_of_dicts: list, n_splits: int = None): function format_figure (line 486) | def format_figure( function generate_chord_dataset (line 593) | def generate_chord_dataset( FILE: xinference/thirdparty/audiotools/core/whisper.py class WhisperMixin (line 4) | class WhisperMixin: method setup_whisper (line 7) | def setup_whisper( method get_whisper_features (line 24) | def get_whisper_features(self) -> torch.Tensor: method get_whisper_transcript (line 56) | def get_whisper_transcript(self) -> str: method get_whisper_embeddings (line 77) | def get_whisper_embeddings(self) -> torch.Tensor: FILE: xinference/thirdparty/audiotools/data/datasets.py class AudioLoader (line 15) | class AudioLoader: method __init__ (line 44) | def __init__( method __call__ (line 71) | def __call__( function default_matcher (line 138) | def default_matcher(x, y): function align_lists (line 142) | def align_lists(lists, matcher: Callable = default_matcher): class AudioDataset (line 153) | class AudioDataset: method __init__ (line 358) | def __init__( method __getitem__ (line 399) | def __getitem__(self, idx): method __len__ (line 454) | def __len__(self): method collate (line 458) | def collate(list_of_dicts: Union[list, dict], n_splits: int = None): class ConcatDataset (line 478) | class ConcatDataset(AudioDataset): method __init__ (line 479) | def __init__(self, datasets: list): method __len__ (line 482) | def __len__(self): method __getitem__ (line 485) | def __getitem__(self, idx): class ResumableDistributedSampler (line 490) | class ResumableDistributedSampler(DistributedSampler): # pragma: no cover method __init__ (line 493) | def __init__(self, dataset, start_idx: int = None, **kwargs): method __iter__ (line 498) | def __iter__(self): class ResumableSequentialSampler (line 505) | class ResumableSequentialSampler(SequentialSampler): # pragma: no cover method __init__ (line 508) | def __init__(self, dataset, start_idx: int = None, **kwargs): method __iter__ (line 513) | def __iter__(self): FILE: xinference/thirdparty/audiotools/data/preprocess.py function create_csv (line 10) | def create_csv( FILE: xinference/thirdparty/audiotools/data/transforms.py class BaseTransform (line 21) | class BaseTransform: method __init__ (line 82) | def __init__(self, keys: list = [], name: str = None, prob: float = 1.0): method _prepare (line 100) | def _prepare(self, batch: dict): method _transform (line 108) | def _transform(self, signal): method _instantiate (line 111) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): method apply_mask (line 115) | def apply_mask(batch: dict, mask: torch.Tensor): method transform (line 133) | def transform(self, signal: AudioSignal, **kwargs): method __call__ (line 168) | def __call__(self, *args, **kwargs): method instantiate (line 171) | def instantiate( method batch_instantiate (line 228) | def batch_instantiate( class Identity (line 268) | class Identity(BaseTransform): class SpectralTransform (line 274) | class SpectralTransform(BaseTransform): method transform (line 282) | def transform(self, signal, **kwargs): class Compose (line 289) | class Compose(BaseTransform): method __init__ (line 346) | def __init__(self, *transforms: list, name: str = None, prob: float = ... method filter (line 360) | def filter(self, *names: list): method _transform (line 404) | def _transform(self, signal, **kwargs): method _instantiate (line 410) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): method __getitem__ (line 416) | def __getitem__(self, idx): method __len__ (line 419) | def __len__(self): method __iter__ (line 422) | def __iter__(self): class Choose (line 427) | class Choose(Compose): method __init__ (line 450) | def __init__( method _instantiate (line 464) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): class Repeat (line 478) | class Repeat(Compose): method __init__ (line 489) | def __init__( class RepeatUpTo (line 502) | class RepeatUpTo(Choose): method __init__ (line 515) | def __init__( class ClippingDistortion (line 531) | class ClippingDistortion(BaseTransform): method __init__ (line 547) | def __init__( method _instantiate (line 557) | def _instantiate(self, state: RandomState): method _transform (line 560) | def _transform(self, signal, perc): class Equalizer (line 564) | class Equalizer(BaseTransform): method __init__ (line 582) | def __init__( method _instantiate (line 594) | def _instantiate(self, state: RandomState): method _transform (line 599) | def _transform(self, signal, eq): class Quantization (line 603) | class Quantization(BaseTransform): method __init__ (line 619) | def __init__( method _instantiate (line 629) | def _instantiate(self, state: RandomState): method _transform (line 632) | def _transform(self, signal, channels): class MuLawQuantization (line 636) | class MuLawQuantization(BaseTransform): method __init__ (line 652) | def __init__( method _instantiate (line 662) | def _instantiate(self, state: RandomState): method _transform (line 665) | def _transform(self, signal, channels): class NoiseFloor (line 669) | class NoiseFloor(BaseTransform): method __init__ (line 684) | def __init__( method _instantiate (line 694) | def _instantiate(self, state: RandomState, signal: AudioSignal): method _transform (line 701) | def _transform(self, signal, nz_signal): class BackgroundNoise (line 707) | class BackgroundNoise(BaseTransform): method __init__ (line 755) | def __init__( method _instantiate (line 774) | def _instantiate(self, state: RandomState, signal: AudioSignal): method _transform (line 789) | def _transform(self, signal, bg_signal, snr, eq): class CrossTalk (line 795) | class CrossTalk(BaseTransform): method __init__ (line 821) | def __init__( method _instantiate (line 836) | def _instantiate(self, state: RandomState, signal: AudioSignal): method _transform (line 848) | def _transform(self, signal, crosstalk_signal, snr): class RoomImpulseResponse (line 857) | class RoomImpulseResponse(BaseTransform): method __init__ (line 892) | def __init__( method _instantiate (line 916) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): method _transform (line 933) | def _transform(self, signal, ir_signal, drr, eq): class VolumeChange (line 941) | class VolumeChange(BaseTransform): method __init__ (line 957) | def __init__( method _instantiate (line 966) | def _instantiate(self, state: RandomState): method _transform (line 969) | def _transform(self, signal, db): class VolumeNorm (line 973) | class VolumeNorm(BaseTransform): method __init__ (line 989) | def __init__( method _instantiate (line 999) | def _instantiate(self, state: RandomState): method _transform (line 1002) | def _transform(self, signal, db): class GlobalVolumeNorm (line 1006) | class GlobalVolumeNorm(BaseTransform): method __init__ (line 1041) | def __init__( method _instantiate (line 1051) | def _instantiate(self, state: RandomState, signal: AudioSignal): method _transform (line 1062) | def _transform(self, signal, db): class Silence (line 1066) | class Silence(BaseTransform): method __init__ (line 1078) | def __init__(self, name: str = None, prob: float = 0.1): method _transform (line 1081) | def _transform(self, signal): class LowPass (line 1095) | class LowPass(BaseTransform): method __init__ (line 1115) | def __init__( method _instantiate (line 1127) | def _instantiate(self, state: RandomState): method _transform (line 1130) | def _transform(self, signal, cutoff): class HighPass (line 1134) | class HighPass(BaseTransform): method __init__ (line 1154) | def __init__( method _instantiate (line 1166) | def _instantiate(self, state: RandomState): method _transform (line 1169) | def _transform(self, signal, cutoff): class RescaleAudio (line 1173) | class RescaleAudio(BaseTransform): method __init__ (line 1191) | def __init__(self, val: float = 1.0, name: str = None, prob: float = 1): method _transform (line 1196) | def _transform(self, signal): class ShiftPhase (line 1200) | class ShiftPhase(SpectralTransform): method __init__ (line 1216) | def __init__( method _instantiate (line 1225) | def _instantiate(self, state: RandomState): method _transform (line 1228) | def _transform(self, signal, shift): class InvertPhase (line 1232) | class InvertPhase(ShiftPhase): method __init__ (line 1246) | def __init__(self, name: str = None, prob: float = 1): class CorruptPhase (line 1250) | class CorruptPhase(SpectralTransform): method __init__ (line 1266) | def __init__( method _instantiate (line 1272) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): method _transform (line 1277) | def _transform(self, signal, corruption): class FrequencyMask (line 1281) | class FrequencyMask(SpectralTransform): method __init__ (line 1300) | def __init__( method _instantiate (line 1311) | def _instantiate(self, state: RandomState, signal: AudioSignal): method _transform (line 1323) | def _transform(self, signal, fmin_hz: float, fmax_hz: float): class TimeMask (line 1327) | class TimeMask(SpectralTransform): method __init__ (line 1346) | def __init__( method _instantiate (line 1357) | def _instantiate(self, state: RandomState, signal: AudioSignal): method _transform (line 1368) | def _transform(self, signal, tmin_s: float, tmax_s: float): class MaskLowMagnitudes (line 1372) | class MaskLowMagnitudes(SpectralTransform): method __init__ (line 1389) | def __init__( method _instantiate (line 1398) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): method _transform (line 1401) | def _transform(self, signal, db_cutoff: float): class Smoothing (line 1405) | class Smoothing(BaseTransform): method __init__ (line 1424) | def __init__( method _instantiate (line 1435) | def _instantiate(self, state: RandomState, signal: AudioSignal = None): method _transform (line 1443) | def _transform(self, signal, window): class TimeNoise (line 1456) | class TimeNoise(TimeMask): method __init__ (line 1474) | def __init__( method _transform (line 1483) | def _transform(self, signal, tmin_s: float, tmax_s: float): class FrequencyNoise (line 1498) | class FrequencyNoise(FrequencyMask): method __init__ (line 1515) | def __init__( method _transform (line 1524) | def _transform(self, signal, fmin_hz: float, fmax_hz: float): class SpectralDenoising (line 1539) | class SpectralDenoising(Equalizer): method __init__ (line 1565) | def __init__( method _transform (line 1582) | def _transform(self, signal, nz, eq, denoise_amount): method _instantiate (line 1588) | def _instantiate(self, state: RandomState): FILE: xinference/thirdparty/audiotools/metrics/distance.py class L1Loss (line 7) | class L1Loss(nn.L1Loss): method __init__ (line 20) | def __init__(self, attribute: str = "audio_data", weight: float = 1.0,... method forward (line 25) | def forward(self, x: AudioSignal, y: AudioSignal): class SISDRLoss (line 45) | class SISDRLoss(nn.Module): method __init__ (line 68) | def __init__( method forward (line 83) | def forward(self, x: AudioSignal, y: AudioSignal): FILE: xinference/thirdparty/audiotools/metrics/quality.py function stoi (line 9) | def stoi( function pesq (line 64) | def pesq( function visqol (line 105) | def visqol( FILE: xinference/thirdparty/audiotools/metrics/spectral.py class MultiScaleSTFTLoss (line 11) | class MultiScaleSTFTLoss(nn.Module): method __init__ (line 41) | def __init__( method forward (line 70) | def forward(self, x: AudioSignal, y: AudioSignal): class MelSpectrogramLoss (line 98) | class MelSpectrogramLoss(nn.Module): method __init__ (line 124) | def __init__( method forward (line 159) | def forward(self, x: AudioSignal, y: AudioSignal): class PhaseLoss (line 195) | class PhaseLoss(nn.Module): method __init__ (line 208) | def __init__( method forward (line 216) | def forward(self, x: AudioSignal, y: AudioSignal): FILE: xinference/thirdparty/audiotools/ml/accelerator.py class Accelerator (line 13) | class Accelerator: # pragma: no cover method __init__ (line 33) | def __init__(self, amp: bool = False): method __enter__ (line 74) | def __enter__(self): method __exit__ (line 79) | def __exit__(self, exc_type, exc_value, traceback): method prepare_model (line 83) | def prepare_model(self, model: torch.nn.Module, **kwargs): method autocast (line 108) | def autocast(self, *args, **kwargs): method backward (line 114) | def backward(self, loss: torch.Tensor): method step (line 125) | def step(self, optimizer: torch.optim.Optimizer): method update (line 136) | def update(self): method prepare_dataloader (line 140) | def prepare_dataloader( method unwrap (line 177) | def unwrap(model): FILE: xinference/thirdparty/audiotools/ml/decorators.py function default_list (line 27) | def default_list(): class Mean (line 31) | class Mean: method __init__ (line 36) | def __init__(self): method __call__ (line 39) | def __call__(self): method reset (line 43) | def reset(self): method update (line 47) | def update(self, val): function when (line 53) | def when(condition): function timer (line 91) | def timer(prefix: str = "time"): class Tracker (line 118) | class Tracker: method __init__ (line 163) | def __init__( method print (line 209) | def print(self, msg): method update (line 222) | def update(self, label, fn_name): method done (line 262) | def done(self, label: str, title: str): method track (line 283) | def track( method log (line 354) | def log(self, label: str, value_type: str = "value", history: bool = T... method is_best (line 395) | def is_best(self, label, key): method state_dict (line 413) | def state_dict(self): method load_state_dict (line 424) | def load_state_dict(self, state_dict): FILE: xinference/thirdparty/audiotools/ml/experiment.py class Experiment (line 16) | class Experiment: method __init__ (line 33) | def __init__( method __enter__ (line 54) | def __enter__(self): method __exit__ (line 59) | def __exit__(self, exc_type, exc_value, traceback): method generate_exp_name (line 63) | def generate_exp_name(): method snapshot (line 76) | def snapshot(self, filter_fn: typing.Callable = lambda f: True): FILE: xinference/thirdparty/audiotools/ml/layers/base.py class BaseModel (line 11) | class BaseModel(nn.Module): method save (line 66) | def save( method device (line 132) | def device(self): method load (line 140) | def load( method _save_package (line 188) | def _save_package(self, path, intern=[], extern=[], mock=[], **kwargs): method _load_package (line 223) | def _load_package(cls, path, package_name=None): method save_to_folder (line 237) | def save_to_folder( method load_from_folder (line 288) | def load_from_folder( FILE: xinference/thirdparty/audiotools/ml/layers/spectral_gate.py class SpectralGate (line 10) | class SpectralGate(nn.Module): method __init__ (line 37) | def __init__(self, n_freq: int = 3, n_time: int = 5): method forward (line 58) | def forward( FILE: xinference/thirdparty/audiotools/post.py function audio_table (line 12) | def audio_table( function in_notebook (line 93) | def in_notebook(): # pragma: no cover function disp (line 113) | def disp(obj, **kwargs): # pragma: no cover FILE: xinference/thirdparty/audiotools/preference.py class Player (line 239) | class Player: method __init__ (line 240) | def __init__(self, app): method create (line 249) | def create(self): method add (line 266) | def add(self, name: str = "Play"): method to_list (line 279) | def to_list(self): function create_tracker (line 371) | def create_tracker(app, cookie_name="name"): class Samples (line 523) | class Samples: method __init__ (line 524) | def __init__(self, folder: str, shuffle: bool = True, n_samples: int =... method get_updates (line 542) | def get_updates(self, idx, order): method progress (line 546) | def progress(self): method __len__ (line 559) | def __len__(self): method filter_completed (line 562) | def filter_completed(self, user, save_path): method get_next_sample (line 573) | def get_next_sample(self, reference, conditions): function save_result (line 595) | def save_result(result, save_path): FILE: xinference/thirdparty/cosyvoice/bin/average_model.py function get_args (line 24) | def get_args(): function main (line 43) | def main(): FILE: xinference/thirdparty/cosyvoice/bin/export_jit.py function get_args (line 30) | def get_args(): function get_optimized_script (line 41) | def get_optimized_script(model, preserved_attrs=[]): function main (line 51) | def main(): FILE: xinference/thirdparty/cosyvoice/bin/export_onnx.py function get_dummy_input (line 34) | def get_dummy_input(batch_size, seq_len, out_channels, device): function get_args (line 44) | def get_args(): function main (line 56) | def main(): FILE: xinference/thirdparty/cosyvoice/bin/inference_deprecated.py function get_args (line 30) | def get_args(): function main (line 54) | def main(): FILE: xinference/thirdparty/cosyvoice/bin/train.py function get_args (line 40) | def get_args(): function main (line 97) | def main(): FILE: xinference/thirdparty/cosyvoice/cli/cosyvoice.py class CosyVoice (line 27) | class CosyVoice: method __init__ (line 29) | def __init__(self, model_dir, load_jit=False, load_trt=False, fp16=Fal... method list_available_spks (line 66) | def list_available_spks(self): method add_zero_shot_spk (line 70) | def add_zero_shot_spk(self, prompt_text, prompt_speech_16k, zero_shot_... method save_spkinfo (line 78) | def save_spkinfo(self): method inference_sft (line 81) | def inference_sft(self, tts_text, spk_id, stream=False, speed=1.0, tex... method inference_zero_shot (line 92) | def inference_zero_shot(self, tts_text, prompt_text, prompt_speech_16k... method inference_cross_lingual (line 106) | def inference_cross_lingual(self, tts_text, prompt_speech_16k, zero_sh... method inference_instruct (line 117) | def inference_instruct(self, tts_text, spk_id, instruct_text, stream=F... method inference_vc (line 132) | def inference_vc(self, source_speech_16k, prompt_speech_16k, stream=Fa... class CosyVoice2 (line 142) | class CosyVoice2(CosyVoice): method __init__ (line 144) | def __init__(self, model_dir, load_jit=False, load_trt=False, load_vll... method inference_instruct (line 181) | def inference_instruct(self, *args, **kwargs): method inference_instruct2 (line 184) | def inference_instruct2(self, tts_text, instruct_text, prompt_speech_1... FILE: xinference/thirdparty/cosyvoice/cli/frontend.py class CosyVoiceFrontEnd (line 39) | class CosyVoiceFrontEnd: method __init__ (line 41) | def __init__(self, method _extract_text_token (line 75) | def _extract_text_token(self, text): method _extract_text_token_generator (line 86) | def _extract_text_token_generator(self, text_generator): method _extract_speech_token (line 92) | def _extract_speech_token(self, speech): method _extract_spk_embedding (line 104) | def _extract_spk_embedding(self, speech): method _extract_speech_feat (line 115) | def _extract_speech_feat(self, speech): method text_normalize (line 121) | def text_normalize(self, text, split=True, text_frontend=True): method frontend_sft (line 151) | def frontend_sft(self, tts_text, spk_id): method frontend_zero_shot (line 157) | def frontend_zero_shot(self, tts_text, prompt_text, prompt_speech_16k,... method frontend_cross_lingual (line 181) | def frontend_cross_lingual(self, tts_text, prompt_speech_16k, resample... method frontend_instruct (line 190) | def frontend_instruct(self, tts_text, spk_id, instruct_text): method frontend_instruct2 (line 199) | def frontend_instruct2(self, tts_text, instruct_text, prompt_speech_16... method frontend_vc (line 205) | def frontend_vc(self, source_speech_16k, prompt_speech_16k, resample_r... FILE: xinference/thirdparty/cosyvoice/cli/model.py class CosyVoiceModel (line 29) | class CosyVoiceModel: method __init__ (line 31) | def __init__(self, method load (line 67) | def load(self, llm_model, flow_model, hift_model): method load_jit (line 77) | def load_jit(self, llm_text_encoder_model, llm_llm_model, flow_encoder... method load_trt (line 85) | def load_trt(self, flow_decoder_estimator_model, flow_decoder_onnx_mod... method get_trt_kwargs (line 96) | def get_trt_kwargs(self): method llm_job (line 103) | def llm_job(self, text, prompt_text, llm_prompt_speech_token, llm_embe... method vc_job (line 126) | def vc_job(self, source_speech_token, uuid): method token2wav (line 130) | def token2wav(self, token, prompt_token, prompt_feat, embedding, uuid,... method tts (line 170) | def tts(self, text=torch.zeros(1, 0, dtype=torch.int32), flow_embeddin... class CosyVoice2Model (line 240) | class CosyVoice2Model(CosyVoiceModel): method __init__ (line 242) | def __init__(self, method load_jit (line 270) | def load_jit(self, flow_encoder_model): method load_vllm (line 274) | def load_vllm(self, model_dir): method token2wav (line 285) | def token2wav(self, token, prompt_token, prompt_feat, embedding, token... method tts (line 321) | def tts(self, text=torch.zeros(1, 0, dtype=torch.int32), flow_embeddin... FILE: xinference/thirdparty/cosyvoice/dataset/dataset.py class Processor (line 26) | class Processor(IterableDataset): method __init__ (line 28) | def __init__(self, source, f, *args, **kw): method set_epoch (line 35) | def set_epoch(self, epoch): method __iter__ (line 38) | def __iter__(self): method apply (line 46) | def apply(self, f): class DistributedSampler (line 51) | class DistributedSampler: method __init__ (line 53) | def __init__(self, shuffle=True, partition=True): method update (line 59) | def update(self): method set_epoch (line 79) | def set_epoch(self, epoch): method sample (line 82) | def sample(self, data): class DataList (line 107) | class DataList(IterableDataset): method __init__ (line 109) | def __init__(self, lists, shuffle=True, partition=True): method set_epoch (line 113) | def set_epoch(self, epoch): method __iter__ (line 116) | def __iter__(self): function Dataset (line 125) | def Dataset(data_list_file, FILE: xinference/thirdparty/cosyvoice/dataset/processor.py function parquet_opener (line 29) | def parquet_opener(data, mode='train', tts_data={}): function filter (line 57) | def filter(data, function resample (line 111) | def resample(data, resample_rate=22050, min_sample_rate=16000, mode='tra... function truncate (line 139) | def truncate(data, truncate_length=24576, mode='train'): function compute_fbank (line 160) | def compute_fbank(data, function compute_f0 (line 188) | def compute_f0(data, sample_rate, hop_size, mode='train'): function parse_embedding (line 213) | def parse_embedding(data, normalize, mode='train'): function tokenize (line 231) | def tokenize(data, get_tokenizer, allowed_special, mode='train'): function shuffle (line 248) | def shuffle(data, shuffle_size=10000, mode='train'): function sort (line 272) | def sort(data, sort_size=500, mode='train'): function static_batch (line 300) | def static_batch(data, batch_size=16): function dynamic_batch (line 320) | def dynamic_batch(data, max_frames_in_batch=12000, mode='train'): function batch (line 349) | def batch(data, batch_type='static', batch_size=16, max_frames_in_batch=... function padding (line 360) | def padding(data, use_spk_embedding, mode='train', gan=False, dpo=False): FILE: xinference/thirdparty/cosyvoice/flow/decoder.py class Transpose (line 25) | class Transpose(torch.nn.Module): method __init__ (line 26) | def __init__(self, dim0: int, dim1: int): method forward (line 31) | def forward(self, x: torch.Tensor) -> torch.Tensor: class CausalConv1d (line 36) | class CausalConv1d(torch.nn.Conv1d): method __init__ (line 37) | def __init__( method forward (line 59) | def forward(self, x: torch.Tensor) -> torch.Tensor: class CausalBlock1D (line 65) | class CausalBlock1D(Block1D): method __init__ (line 66) | def __init__(self, dim: int, dim_out: int): method forward (line 76) | def forward(self, x: torch.Tensor, mask: torch.Tensor) -> Tuple[torch.... class CausalResnetBlock1D (line 81) | class CausalResnetBlock1D(ResnetBlock1D): method __init__ (line 82) | def __init__(self, dim: int, dim_out: int, time_emb_dim: int, groups: ... class ConditionalDecoder (line 88) | class ConditionalDecoder(nn.Module): method __init__ (line 89) | def __init__( method initialize_weights (line 196) | def initialize_weights(self): method forward (line 210) | def forward(self, x, mask, mu, t, spks=None, cond=None, streaming=False): class CausalConditionalDecoder (line 294) | class CausalConditionalDecoder(ConditionalDecoder): method __init__ (line 295) | def __init__( method forward (line 405) | def forward(self, x, mask, mu, t, spks=None, cond=None, streaming=False): FILE: xinference/thirdparty/cosyvoice/flow/flow.py class MaskedDiffWithXvec (line 24) | class MaskedDiffWithXvec(torch.nn.Module): method __init__ (line 25) | def __init__(self, method forward (line 60) | def forward( method inference (line 105) | def inference(self, class CausalMaskedDiffWithXvec (line 151) | class CausalMaskedDiffWithXvec(torch.nn.Module): method __init__ (line 152) | def __init__(self, method forward (line 189) | def forward( method inference (line 236) | def inference(self, FILE: xinference/thirdparty/cosyvoice/flow/flow_matching.py class ConditionalCFM (line 21) | class ConditionalCFM(BASECFM): method __init__ (line 22) | def __init__(self, in_channels, cfm_params, n_spks=1, spk_emb_dim=64, ... method forward (line 37) | def forward(self, mu, mask, n_timesteps, temperature=1.0, spks=None, c... method solve_euler (line 71) | def solve_euler(self, x, t_span, mu, mask, spks, cond, streaming=False): method forward_estimator (line 125) | def forward_estimator(self, x, mask, mu, t, spks, cond, streaming=False): method compute_loss (line 154) | def compute_loss(self, x1, mask, mu, spks=None, cond=None, streaming=F... class CausalConditionalCFM (line 196) | class CausalConditionalCFM(ConditionalCFM): method __init__ (line 197) | def __init__(self, in_channels, cfm_params, n_spks=1, spk_emb_dim=64, ... method forward (line 203) | def forward(self, mu, mask, n_timesteps, temperature=1.0, spks=None, c... FILE: xinference/thirdparty/cosyvoice/flow/length_regulator.py class InterpolateRegulator (line 21) | class InterpolateRegulator(nn.Module): method __init__ (line 22) | def __init__( method forward (line 44) | def forward(self, x, ylens=None): method inference (line 52) | def inference(self, x1, x2, mel_len1, mel_len2, input_frame_rate=50): FILE: xinference/thirdparty/cosyvoice/hifigan/discriminator.py class MultipleDiscriminator (line 15) | class MultipleDiscriminator(nn.Module): method __init__ (line 16) | def __init__( method forward (line 23) | def forward(self, y: torch.Tensor, y_hat: torch.Tensor): class MultiResolutionDiscriminator (line 38) | class MultiResolutionDiscriminator(nn.Module): method __init__ (line 39) | def __init__( method forward (line 59) | def forward( class DiscriminatorR (line 78) | class DiscriminatorR(nn.Module): method __init__ (line 79) | def __init__( method spectrogram (line 113) | def spectrogram(self, x): method forward (line 125) | def forward(self, x: torch.Tensor, cond_embedding_id: torch.Tensor = N... class MultiResSpecDiscriminator (line 149) | class MultiResSpecDiscriminator(torch.nn.Module): method __init__ (line 151) | def __init__(self, method forward (line 163) | def forward(self, y, y_hat): function stft (line 179) | def stft(x, fft_size, hop_size, win_length, window): class SpecDiscriminator (line 196) | class SpecDiscriminator(nn.Module): method __init__ (line 199) | def __init__(self, fft_size=1024, shift_size=120, win_length=600, wind... method forward (line 216) | def forward(self, y): FILE: xinference/thirdparty/cosyvoice/hifigan/f0_predictor.py class ConvRNNF0Predictor (line 22) | class ConvRNNF0Predictor(nn.Module): method __init__ (line 23) | def __init__(self, method forward (line 55) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/cosyvoice/hifigan/generator.py class ResBlock (line 46) | class ResBlock(torch.nn.Module): method __init__ (line 48) | def __init__( method forward (line 94) | def forward(self, x: torch.Tensor) -> torch.Tensor: method remove_weight_norm (line 103) | def remove_weight_norm(self): class SineGen (line 109) | class SineGen(torch.nn.Module): method __init__ (line 125) | def __init__(self, samp_rate, harmonic_num=0, method _f02uv (line 135) | def _f02uv(self, f0): method forward (line 141) | def forward(self, f0): class SourceModuleHnNSF (line 174) | class SourceModuleHnNSF(torch.nn.Module): method __init__ (line 192) | def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine... method forward (line 207) | def forward(self, x): class SineGen2 (line 226) | class SineGen2(torch.nn.Module): method __init__ (line 242) | def __init__(self, samp_rate, upsample_scale, harmonic_num=0, method _f02uv (line 256) | def _f02uv(self, f0): method _f02sine (line 261) | def _f02sine(self, f0_values): method forward (line 314) | def forward(self, f0): class SourceModuleHnNSF2 (line 342) | class SourceModuleHnNSF2(torch.nn.Module): method __init__ (line 360) | def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine... method forward (line 375) | def forward(self, x): class HiFTGenerator (line 392) | class HiFTGenerator(nn.Module): method __init__ (line 397) | def __init__( method remove_weight_norm (line 490) | def remove_weight_norm(self): method _stft (line 504) | def _stft(self, x): method _istft (line 512) | def _istft(self, magnitude, phase): method decode (line 520) | def decode(self, x: torch.Tensor, s: torch.Tensor = torch.zeros(1, 1, ... method forward (line 554) | def forward( method inference (line 571) | def inference(self, speech_feat: torch.Tensor, cache_source: torch.Ten... FILE: xinference/thirdparty/cosyvoice/hifigan/hifigan.py class HiFiGan (line 9) | class HiFiGan(nn.Module): method __init__ (line 10) | def __init__(self, generator, discriminator, mel_spec_transform, method forward (line 22) | def forward( method forward_generator (line 32) | def forward_generator(self, batch, device): method forward_discriminator (line 53) | def forward_discriminator(self, batch, device): FILE: xinference/thirdparty/cosyvoice/llm/llm.py class TransformerLM (line 32) | class TransformerLM(torch.nn.Module): method __init__ (line 33) | def __init__( method encode (line 78) | def encode( method pad_unpad_sequence (line 88) | def pad_unpad_sequence(self, sos_eos_emb, embedding, text_token, text_... method forward (line 97) | def forward( method sampling_ids (line 147) | def sampling_ids( method inference (line 165) | def inference( class Qwen2Encoder (line 231) | class Qwen2Encoder(torch.nn.Module): method __init__ (line 232) | def __init__(self, pretrain_path): method forward (line 236) | def forward(self, xs: torch.Tensor, xs_lens: torch.Tensor): method forward_one_step (line 247) | def forward_one_step(self, xs, masks, cache=None): class Qwen2LM (line 262) | class Qwen2LM(TransformerLM): method __init__ (line 263) | def __init__( method prepare_lm_input_target (line 304) | def prepare_lm_input_target(self, text_token, text_token_emb, text_tok... method forward (line 346) | def forward( method forward_dpo (line 380) | def forward_dpo( method inference (line 428) | def inference( method inference_wrapper (line 465) | def inference_wrapper(self, lm_input, sampling, min_len, max_len, uuid): method inference_bistream (line 514) | def inference_bistream( FILE: xinference/thirdparty/cosyvoice/tokenizer/tokenizer.py function get_encoding (line 170) | def get_encoding(name: str = "gpt2", num_languages: int = 99): function get_tokenizer (line 210) | def get_tokenizer( class QwenTokenizer (line 241) | class QwenTokenizer(): method __init__ (line 242) | def __init__(self, token_path, skip_special_tokens=True): method encode (line 263) | def encode(self, text, **kwargs): method decode (line 268) | def decode(self, tokens): function get_qwen_tokenizer (line 275) | def get_qwen_tokenizer( FILE: xinference/thirdparty/cosyvoice/transformer/activation.py class Swish (line 24) | class Swish(torch.nn.Module): method forward (line 27) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Snake (line 34) | class Snake(nn.Module): method __init__ (line 50) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 73) | def forward(self, x): FILE: xinference/thirdparty/cosyvoice/transformer/attention.py class MultiHeadedAttention (line 26) | class MultiHeadedAttention(nn.Module): method __init__ (line 36) | def __init__(self, method forward_qkv (line 53) | def forward_qkv( method forward_attention (line 82) | def forward_attention( method forward (line 129) | def forward( class RelPositionMultiHeadedAttention (line 200) | class RelPositionMultiHeadedAttention(MultiHeadedAttention): method __init__ (line 209) | def __init__(self, method rel_shift (line 225) | def rel_shift(self, x: torch.Tensor) -> torch.Tensor: method forward (line 249) | def forward( FILE: xinference/thirdparty/cosyvoice/transformer/convolution.py class ConvolutionModule (line 24) | class ConvolutionModule(nn.Module): method __init__ (line 27) | def __init__(self, method forward (line 90) | def forward( FILE: xinference/thirdparty/cosyvoice/transformer/decoder.py class TransformerDecoder (line 33) | class TransformerDecoder(torch.nn.Module): method __init__ (line 58) | def __init__( method forward (line 116) | def forward( method forward_layers (line 169) | def forward_layers(self, x: torch.Tensor, tgt_mask: torch.Tensor, method forward_layers_checkpointed (line 178) | def forward_layers_checkpointed(self, x: torch.Tensor, method forward_one_step (line 187) | def forward_one_step( method tie_or_clone_weights (line 230) | def tie_or_clone_weights(self, jit_mode: bool = True): class BiTransformerDecoder (line 256) | class BiTransformerDecoder(torch.nn.Module): method __init__ (line 276) | def __init__( method forward (line 332) | def forward( method forward_one_step (line 367) | def forward_one_step( method tie_or_clone_weights (line 392) | def tie_or_clone_weights(self, jit_mode: bool = True): FILE: xinference/thirdparty/cosyvoice/transformer/decoder_layer.py class DecoderLayer (line 22) | class DecoderLayer(nn.Module): method __init__ (line 41) | def __init__( method forward (line 62) | def forward( FILE: xinference/thirdparty/cosyvoice/transformer/embedding.py class PositionalEncoding (line 26) | class PositionalEncoding(torch.nn.Module): method __init__ (line 37) | def __init__(self, method forward (line 59) | def forward(self, method position_encoding (line 79) | def position_encoding(self, class RelPositionalEncoding (line 120) | class RelPositionalEncoding(PositionalEncoding): method __init__ (line 129) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 5... method forward (line 133) | def forward(self, class WhisperPositionalEncoding (line 150) | class WhisperPositionalEncoding(PositionalEncoding): method __init__ (line 154) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 1... class LearnablePositionalEncoding (line 167) | class LearnablePositionalEncoding(PositionalEncoding): method __init__ (line 171) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 4... class NoPositionalEncoding (line 178) | class NoPositionalEncoding(torch.nn.Module): method __init__ (line 182) | def __init__(self, d_model: int, dropout_rate: float): method forward (line 187) | def forward(self, method position_encoding (line 196) | def position_encoding(self, offset: Union[int, torch.Tensor], class EspnetRelPositionalEncoding (line 201) | class EspnetRelPositionalEncoding(torch.nn.Module): method __init__ (line 215) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 5... method extend_pe (line 224) | def extend_pe(self, x: torch.Tensor): method forward (line 256) | def forward(self, x: torch.Tensor, offset: Union[int, torch.Tensor] = ... method position_encoding (line 272) | def position_encoding(self, FILE: xinference/thirdparty/cosyvoice/transformer/encoder.py class BaseEncoder (line 37) | class BaseEncoder(torch.nn.Module): method __init__ (line 39) | def __init__( method output_size (line 108) | def output_size(self) -> int: method forward (line 111) | def forward( method forward_layers (line 165) | def forward_layers(self, xs: torch.Tensor, chunk_masks: torch.Tensor, method forward_layers_checkpointed (line 173) | def forward_layers_checkpointed(self, xs: torch.Tensor, method forward_chunk (line 184) | def forward_chunk( method forward_chunk_by_chunk (line 275) | def forward_chunk_by_chunk( class TransformerEncoder (line 338) | class TransformerEncoder(BaseEncoder): method __init__ (line 341) | def __init__( class ConformerEncoder (line 387) | class ConformerEncoder(BaseEncoder): method __init__ (line 390) | def __init__( FILE: xinference/thirdparty/cosyvoice/transformer/encoder_layer.py class TransformerEncoderLayer (line 24) | class TransformerEncoderLayer(nn.Module): method __init__ (line 40) | def __init__( method forward (line 58) | def forward( class ConformerEncoderLayer (line 109) | class ConformerEncoderLayer(nn.Module): method __init__ (line 129) | def __init__( method forward (line 160) | def forward( FILE: xinference/thirdparty/cosyvoice/transformer/label_smoothing_loss.py class LabelSmoothingLoss (line 21) | class LabelSmoothingLoss(nn.Module): method __init__ (line 54) | def __init__(self, method forward (line 68) | def forward(self, x: torch.Tensor, target: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/cosyvoice/transformer/positionwise_feed_forward.py class PositionwiseFeedForward (line 20) | class PositionwiseFeedForward(torch.nn.Module): method __init__ (line 33) | def __init__( method forward (line 47) | def forward(self, xs: torch.Tensor) -> torch.Tensor: class MoEFFNLayer (line 58) | class MoEFFNLayer(torch.nn.Module): method __init__ (line 75) | def __init__( method forward (line 91) | def forward(self, xs: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/cosyvoice/transformer/subsampling.py class BaseSubsampling (line 23) | class BaseSubsampling(torch.nn.Module): method __init__ (line 25) | def __init__(self): method position_encoding (line 30) | def position_encoding(self, offset: Union[int, torch.Tensor], class EmbedinigNoSubsampling (line 35) | class EmbedinigNoSubsampling(BaseSubsampling): method __init__ (line 39) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 45) | def forward( class LinearNoSubsampling (line 69) | class LinearNoSubsampling(BaseSubsampling): method __init__ (line 79) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 92) | def forward( class Conv1dSubsampling2 (line 116) | class Conv1dSubsampling2(BaseSubsampling): method __init__ (line 128) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 145) | def forward( class Conv2dSubsampling4 (line 173) | class Conv2dSubsampling4(BaseSubsampling): method __init__ (line 183) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 202) | def forward( class Conv2dSubsampling6 (line 230) | class Conv2dSubsampling6(BaseSubsampling): method __init__ (line 239) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 256) | def forward( class Conv2dSubsampling8 (line 282) | class Conv2dSubsampling8(BaseSubsampling): method __init__ (line 292) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 311) | def forward( class LegacyLinearNoSubsampling (line 338) | class LegacyLinearNoSubsampling(BaseSubsampling): method __init__ (line 348) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 362) | def forward( FILE: xinference/thirdparty/cosyvoice/transformer/upsample_encoder.py class Upsample1D (line 37) | class Upsample1D(nn.Module): method __init__ (line 51) | def __init__(self, channels: int, out_channels: int, stride: int = 2): method forward (line 59) | def forward(self, inputs: torch.Tensor, input_lengths: torch.Tensor) -... class PreLookaheadLayer (line 66) | class PreLookaheadLayer(nn.Module): method __init__ (line 67) | def __init__(self, channels: int, pre_lookahead_len: int = 1): method forward (line 81) | def forward(self, inputs: torch.Tensor, context: torch.Tensor = torch.... class UpsampleConformerEncoder (line 105) | class UpsampleConformerEncoder(torch.nn.Module): method __init__ (line 107) | def __init__( method output_size (line 240) | def output_size(self) -> int: method forward (line 243) | def forward( method forward_layers (line 308) | def forward_layers(self, xs: torch.Tensor, chunk_masks: torch.Tensor, method forward_up_layers (line 315) | def forward_up_layers(self, xs: torch.Tensor, chunk_masks: torch.Tensor, FILE: xinference/thirdparty/cosyvoice/utils/class_utils.py function get_model_type (line 77) | def get_model_type(configs): FILE: xinference/thirdparty/cosyvoice/utils/common.py function pad_list (line 29) | def pad_list(xs: List[torch.Tensor], pad_value: int): function th_accuracy (line 78) | def th_accuracy(pad_outputs: torch.Tensor, pad_targets: torch.Tensor, function get_padding (line 100) | def get_padding(kernel_size, dilation=1): function init_weights (line 104) | def init_weights(m, mean=0.0, std=0.01): function ras_sampling (line 111) | def ras_sampling(weighted_scores, decoded_tokens, sampling, top_p=0.8, t... function nucleus_sampling (line 119) | def nucleus_sampling(weighted_scores, top_p=0.8, top_k=25): function random_sampling (line 137) | def random_sampling(weighted_scores, decoded_tokens, sampling): function fade_in_out (line 142) | def fade_in_out(fade_in_mel, fade_out_mel, window): function set_all_random_seed (line 153) | def set_all_random_seed(seed): function mask_to_bias (line 160) | def mask_to_bias(mask: torch.Tensor, dtype: torch.dtype) -> torch.Tensor: class TrtContextWrapper (line 171) | class TrtContextWrapper: method __init__ (line 172) | def __init__(self, trt_engine, trt_concurrent=1, device='cuda:0'): method acquire_estimator (line 182) | def acquire_estimator(self): method release_estimator (line 185) | def release_estimator(self, context, stream): FILE: xinference/thirdparty/cosyvoice/utils/executor.py class Executor (line 26) | class Executor: method __init__ (line 28) | def __init__(self, gan: bool = False, ref_model: torch.nn.Module = Non... method train_one_epoc (line 37) | def train_one_epoc(self, model, optimizer, scheduler, train_data_loade... method train_one_epoc_gan (line 88) | def train_one_epoc_gan(self, model, optimizer, scheduler, optimizer_d,... method cv (line 147) | def cv(self, model, cv_data_loader, writer, info_dict, on_batch_end=Tr... FILE: xinference/thirdparty/cosyvoice/utils/file_utils.py function read_lists (line 27) | def read_lists(list_file): function read_json_lists (line 35) | def read_json_lists(list_file): function load_wav (line 44) | def load_wav(wav, target_sr): function convert_onnx_to_trt (line 53) | def convert_onnx_to_trt(trt_model, trt_kwargs, onnx_model, fp16): function export_cosyvoice2_vllm (line 91) | def export_cosyvoice2_vllm(model, model_path, device): FILE: xinference/thirdparty/cosyvoice/utils/frontend_utils.py function contains_chinese (line 21) | def contains_chinese(text): function replace_corner_mark (line 26) | def replace_corner_mark(text): function remove_bracket (line 33) | def remove_bracket(text): function spell_out_number (line 42) | def spell_out_number(text: str, inflect_parser): function split_paragraph (line 65) | def split_paragraph(text: str, tokenize, lang="zh", token_max_n=80, toke... function replace_blank (line 121) | def replace_blank(text: str): function is_only_punctuation (line 133) | def is_only_punctuation(text): FILE: xinference/thirdparty/cosyvoice/utils/losses.py function tpr_loss (line 6) | def tpr_loss(disc_real_outputs, disc_generated_outputs, tau): function mel_loss (line 15) | def mel_loss(real_speech, generated_speech, mel_transforms): class DPOLoss (line 24) | class DPOLoss(torch.nn.Module): method __init__ (line 29) | def __init__(self, beta: float, label_smoothing: float = 0.0, ipo: boo... method forward (line 35) | def forward( FILE: xinference/thirdparty/cosyvoice/utils/mask.py function subsequent_mask (line 53) | def subsequent_mask( function subsequent_chunk_mask_deprecated (line 89) | def subsequent_chunk_mask_deprecated( function subsequent_chunk_mask (line 127) | def subsequent_chunk_mask( function add_optional_chunk_mask (line 161) | def add_optional_chunk_mask(xs: torch.Tensor, function make_pad_mask (line 239) | def make_pad_mask(lengths: torch.Tensor, max_len: int = 0) -> torch.Tensor: FILE: xinference/thirdparty/cosyvoice/utils/scheduler.py class WarmupLR (line 27) | class WarmupLR(_LRScheduler): method __init__ (line 44) | def __init__( method __repr__ (line 56) | def __repr__(self): method get_lr (line 59) | def get_lr(self): method set_step (line 70) | def set_step(self, step: int): class WarmupPolicy (line 74) | class WarmupPolicy(_LRScheduler): method __init__ (line 84) | def __init__(self, method get_lr (line 110) | def get_lr(self): method _get_warmup_lr (line 128) | def _get_warmup_lr(self, step): method _get_lr (line 132) | def _get_lr(self, step): class SquareRootConstantPolicy (line 137) | class SquareRootConstantPolicy(_LRScheduler): method __init__ (line 147) | def __init__(self, method get_lr (line 175) | def get_lr(self): method _get_lr (line 193) | def _get_lr(self, step): class WarmupHoldPolicy (line 198) | class WarmupHoldPolicy(WarmupPolicy): method __init__ (line 212) | def __init__( method get_lr (line 257) | def get_lr(self): class WarmupAnnealHoldPolicy (line 282) | class WarmupAnnealHoldPolicy(_LRScheduler): method __init__ (line 295) | def __init__( method get_lr (line 340) | def get_lr(self): method _get_warmup_lr (line 365) | def _get_warmup_lr(self, step): method _get_constant_lr (line 369) | def _get_constant_lr(self, step): method _get_lr (line 372) | def _get_lr(self, step): function _squareroot_annealing (line 377) | def _squareroot_annealing(initial_lr, step, max_steps, min_lr): function _square_annealing (line 384) | def _square_annealing(initial_lr, step, max_steps, min_lr): function _cosine_annealing (line 391) | def _cosine_annealing(initial_lr, step, max_steps, min_lr): function _linear_warmup_with_cosine_annealing (line 397) | def _linear_warmup_with_cosine_annealing(max_lr, warmup_steps, step, function _poly_decay (line 421) | def _poly_decay(initial_lr, step, decay_steps, power, min_lr, cycle): function _noam_hold_annealing (line 433) | def _noam_hold_annealing(initial_lr, step, warmup_steps, hold_steps, class SquareAnnealing (line 444) | class SquareAnnealing(WarmupPolicy): method __init__ (line 446) | def __init__(self, method _get_lr (line 459) | def _get_lr(self, step): class SquareRootAnnealing (line 471) | class SquareRootAnnealing(WarmupPolicy): method __init__ (line 473) | def __init__(self, method _get_lr (line 486) | def _get_lr(self, step): class CosineAnnealing (line 497) | class CosineAnnealing(WarmupAnnealHoldPolicy): method __init__ (line 499) | def __init__(self, method _get_lr (line 512) | def _get_lr(self, step): method _get_warmup_lr (line 532) | def _get_warmup_lr(self, step): method _get_constant_lr (line 539) | def _get_constant_lr(self, step): method _get_linear_warmup_with_cosine_annealing_lr (line 543) | def _get_linear_warmup_with_cosine_annealing_lr(self, step): class NoamAnnealing (line 558) | class NoamAnnealing(_LRScheduler): method __init__ (line 560) | def __init__(self, method get_lr (line 588) | def get_lr(self): method _noam_annealing (line 610) | def _noam_annealing(self, initial_lr, step): class NoamHoldAnnealing (line 623) | class NoamHoldAnnealing(WarmupHoldPolicy): method __init__ (line 625) | def __init__(self, method _get_lr (line 693) | def _get_lr(self, step): method set_step (line 715) | def set_step(self, step: int): class ConstantLR (line 719) | class ConstantLR(_LRScheduler): method __init__ (line 726) | def __init__( method get_lr (line 734) | def get_lr(self): method set_step (line 737) | def set_step(self, step: int): FILE: xinference/thirdparty/cosyvoice/utils/train_utils.py function init_distributed (line 39) | def init_distributed(args): function init_dataset_and_dataloader (line 53) | def init_dataset_and_dataloader(args, configs, gan, dpo): function check_modify_and_save_config (line 72) | def check_modify_and_save_config(args, configs): function wrap_cuda_model (line 94) | def wrap_cuda_model(args, model): function init_optimizer_and_scheduler (line 111) | def init_optimizer_and_scheduler(args, configs, model, gan): function init_summarywriter (line 187) | def init_summarywriter(args): function save_model (line 195) | def save_model(model, model_name, info_dict): function cosyvoice_join (line 217) | def cosyvoice_join(group_join, info_dict): function batch_forward (line 238) | def batch_forward(model, batch, scaler, info_dict, ref_model=None, dpo_l... function batch_backward (line 277) | def batch_backward(model, scaler, info_dict): function update_parameter_and_lr (line 291) | def update_parameter_and_lr(model, optimizer, scheduler, scaler, info_di... function log_per_step (line 323) | def log_per_step(writer, info_dict): function log_per_save (line 352) | def log_per_save(writer, info_dict): FILE: xinference/thirdparty/cosyvoice/vllm/cosyvoice2.py class CosyVoice2ForCausalLM (line 29) | class CosyVoice2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP): method __init__ (line 42) | def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): method get_input_embeddings (line 73) | def get_input_embeddings(self, input_ids: torch.Tensor) -> torch.Tensor: method forward (line 76) | def forward( method compute_logits (line 87) | def compute_logits( method load_weights (line 96) | def load_weights(self, weights: Iterable[tuple[str, FILE: xinference/thirdparty/deepseek_vl/models/clip_encoder.py class CLIPVisionTower (line 31) | class CLIPVisionTower(nn.Module): method __init__ (line 32) | def __init__( method build_vision_tower (line 71) | def build_vision_tower(self, vision_tower_params): method feature_select (line 89) | def feature_select(self, image_forward_outs): method forward (line 108) | def forward(self, images): class HybridVisionTower (line 126) | class HybridVisionTower(nn.Module): method __init__ (line 127) | def __init__( method forward (line 165) | def forward(self, images: torch.Tensor): FILE: xinference/thirdparty/deepseek_vl/models/image_processing_vlm.py function expand2square (line 41) | def expand2square(pil_img, background_color): class VLMImageProcessorConfig (line 55) | class VLMImageProcessorConfig(PretrainedConfig): method __init__ (line 64) | def __init__( class VLMImageProcessor (line 92) | class VLMImageProcessor(BaseImageProcessor): method __init__ (line 95) | def __init__( method resize (line 127) | def resize(self, pil_img: Image) -> np.ndarray: method preprocess (line 164) | def preprocess(self, images, return_tensors: str = "pt", **kwargs) -> ... method default_shape (line 195) | def default_shape(self): FILE: xinference/thirdparty/deepseek_vl/models/modeling_vlm.py function model_name_to_cls (line 36) | def model_name_to_cls(cls_name): class VisionConfig (line 52) | class VisionConfig(PretrainedConfig): method __init__ (line 57) | def __init__(self, **kwargs): class AlignerConfig (line 67) | class AlignerConfig(PretrainedConfig): method __init__ (line 72) | def __init__(self, **kwargs): class MultiModalityConfig (line 82) | class MultiModalityConfig(PretrainedConfig): method __init__ (line 88) | def __init__(self, **kwargs): class MultiModalityPreTrainedModel (line 103) | class MultiModalityPreTrainedModel(PreTrainedModel): class MultiModalityCausalLM (line 110) | class MultiModalityCausalLM(MultiModalityPreTrainedModel): method __init__ (line 111) | def __init__(self, config: MultiModalityConfig): method prepare_inputs_embeds (line 125) | def prepare_inputs_embeds( FILE: xinference/thirdparty/deepseek_vl/models/processing_vlm.py class DictOutput (line 32) | class DictOutput(object): method keys (line 33) | def keys(self): method __getitem__ (line 36) | def __getitem__(self, item): method __setitem__ (line 39) | def __setitem__(self, key, value): class VLChatProcessorOutput (line 44) | class VLChatProcessorOutput(DictOutput): method __len__ (line 50) | def __len__(self): class BatchedVLChatProcessorOutput (line 55) | class BatchedVLChatProcessorOutput(DictOutput): method to (line 63) | def to(self, device, dtype=torch.bfloat16): class VLChatProcessor (line 72) | class VLChatProcessor(ProcessorMixin): method __init__ (line 84) | def __init__( method new_chat_template (line 125) | def new_chat_template(self): method apply_sft_template_for_multi_turn_prompts (line 130) | def apply_sft_template_for_multi_turn_prompts( method image_token (line 173) | def image_token(self): method image_id (line 177) | def image_id(self): method pad_id (line 182) | def pad_id(self): method add_image_token (line 189) | def add_image_token( method process_one (line 232) | def process_one( method __call__ (line 294) | def __call__( method batchify (line 329) | def batchify( FILE: xinference/thirdparty/deepseek_vl/models/projector.py class MlpProjector (line 27) | class MlpProjector(nn.Module): method __init__ (line 28) | def __init__(self, cfg): method forward (line 63) | def forward( FILE: xinference/thirdparty/deepseek_vl/models/sam.py class MLPBlock (line 17) | class MLPBlock(nn.Module): method __init__ (line 18) | def __init__( method forward (line 29) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 35) | class LayerNorm2d(nn.Module): method __init__ (line 36) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 42) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ImageEncoderViT (line 51) | class ImageEncoderViT(nn.Module): method __init__ (line 52) | def __init__( method forward (line 168) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 201) | class Block(nn.Module): method __init__ (line 204) | def __init__( method forward (line 250) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 269) | class Attention(nn.Module): method __init__ (line 272) | def __init__( method forward (line 308) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 342) | def window_partition( function window_unpartition (line 370) | def window_unpartition( function get_rel_pos (line 400) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 433) | def add_decomposed_rel_pos( class PatchEmbed (line 474) | class PatchEmbed(nn.Module): method __init__ (line 479) | def __init__( method forward (line 501) | def forward(self, x: torch.Tensor) -> torch.Tensor: class SAMViTCfg (line 509) | class SAMViTCfg: function create_sam_vit (line 553) | def create_sam_vit( FILE: xinference/thirdparty/deepseek_vl/models/siglip_vit.py function _no_grad_trunc_normal_ (line 54) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 92) | def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): function init_weights (line 120) | def init_weights(self): function init_weights_vit_timm (line 126) | def init_weights_vit_timm(module: nn.Module, name: str = "") -> None: class Attention (line 136) | class Attention(nn.Module): method __init__ (line 139) | def __init__( method forward (line 164) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerScale (line 194) | class LayerScale(nn.Module): method __init__ (line 195) | def __init__( method forward (line 205) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 209) | class Block(nn.Module): method __init__ (line 210) | def __init__( method forward (line 253) | def forward(self, x: torch.Tensor) -> torch.Tensor: class VisionTransformer (line 259) | class VisionTransformer(nn.Module): method __init__ (line 268) | def __init__( method init_weights (line 434) | def init_weights(self, mode: Literal["jax", "jax_nlhb", "moco", ""] = ... method no_weight_decay (line 443) | def no_weight_decay(self) -> Set: method group_matcher (line 447) | def group_matcher(self, coarse: bool = False) -> Dict: method set_grad_checkpointing (line 454) | def set_grad_checkpointing(self, enable: bool = True) -> None: method get_classifier (line 458) | def get_classifier(self) -> nn.Module: method reset_classifier (line 461) | def reset_classifier(self, num_classes: int, global_pool=None) -> None: method _pos_embed (line 476) | def _pos_embed(self, x: torch.Tensor) -> torch.Tensor: method _intermediate_layers (line 509) | def _intermediate_layers( method get_intermediate_layers (line 531) | def get_intermediate_layers( method forward_features (line 562) | def forward_features(self, x: torch.Tensor) -> torch.Tensor: method forward_head (line 574) | def forward_head(self, x: torch.Tensor, pre_logits: bool = False) -> t... method forward (line 585) | def forward(self, x: torch.Tensor) -> torch.Tensor: class SigLIPVisionCfg (line 593) | class SigLIPVisionCfg: function create_siglip_vit (line 640) | def create_siglip_vit( FILE: xinference/thirdparty/deepseek_vl/serve/app_deepseek.py function load_models (line 43) | def load_models(): function generate_prompt_with_history (line 59) | def generate_prompt_with_history( function to_gradio_chatbot (line 129) | def to_gradio_chatbot(conv): function to_gradio_history (line 165) | def to_gradio_history(conv): function get_prompt (line 170) | def get_prompt(conv) -> str: function predict (line 192) | def predict( function retry (line 278) | def retry( function build_demo (line 314) | def build_demo(MODELS): FILE: xinference/thirdparty/deepseek_vl/serve/app_modules/gradio_utils.py function wrap_gen_fn (line 25) | def wrap_gen_fn(gen_fn): function delete_last_conversation (line 38) | def delete_last_conversation(chatbot, history): function reset_state (line 61) | def reset_state(): function reset_textbox (line 65) | def reset_textbox(): function cancel_outputing (line 69) | def cancel_outputing(): function transfer_input (line 73) | def transfer_input(input_text, input_image): class State (line 84) | class State: method interrupt (line 87) | def interrupt(self): method recover (line 90) | def recover(self): FILE: xinference/thirdparty/deepseek_vl/serve/app_modules/overwrites.py function compact_text_chunks (line 29) | def compact_text_chunks(self, prompt, text_chunks: List[str]) -> List[str]: function postprocess (line 39) | def postprocess( function reload_javascript (line 68) | def reload_javascript(): FILE: xinference/thirdparty/deepseek_vl/serve/app_modules/utils.py function configure_logger (line 40) | def configure_logger(): function strip_stop_words (line 66) | def strip_stop_words(x, stop_words): function format_output (line 73) | def format_output(history, text, x): function markdown_to_html_with_syntax_highlight (line 79) | def markdown_to_html_with_syntax_highlight(md_str): # deprecated function normalize_markdown (line 101) | def normalize_markdown(md_text: str) -> str: # deprecated function convert_mdtext (line 125) | def convert_mdtext(md_text): function convert_asis (line 148) | def convert_asis(userinput): function is_stop_word_or_prefix (line 152) | def is_stop_word_or_prefix(s: str, stop_words: list) -> bool: function detect_converted_mark (line 156) | def detect_converted_mark(userinput): function detect_language (line 160) | def detect_language(code): function convert_to_markdown (line 167) | def convert_to_markdown(text): function add_language_tag (line 204) | def add_language_tag(text): function is_variable_assigned (line 228) | def is_variable_assigned(var_name: str) -> bool: FILE: xinference/thirdparty/deepseek_vl/serve/assets/Kelpy-Codos.js function addCopyButton (line 36) | function addCopyButton(pre) { function handleNewElements (line 81) | function handleNewElements(mutationsList, observer) { FILE: xinference/thirdparty/deepseek_vl/serve/inference.py function load_model (line 36) | def load_model(model_path): function convert_conversation_to_prompts (line 46) | def convert_conversation_to_prompts(conversation: Conversation): class StoppingCriteriaSub (line 66) | class StoppingCriteriaSub(StoppingCriteria): method __init__ (line 67) | def __init__(self, stops=[], encounters=1): method __call__ (line 71) | def __call__( function deepseek_generate (line 84) | def deepseek_generate( function generate (line 120) | def generate( FILE: xinference/thirdparty/deepseek_vl/utils/conversation.py class SeparatorStyle (line 29) | class SeparatorStyle(IntEnum): class Conversation (line 52) | class Conversation: method get_prompt (line 76) | def get_prompt(self) -> str: method get_prompt_for_current_round (line 141) | def get_prompt_for_current_round(self, content=None): method set_system_message (line 153) | def set_system_message(self, system_message: str): method append_message (line 157) | def append_message(self, role: str, message: str): method reset_message (line 161) | def reset_message(self): method update_last_message (line 165) | def update_last_message(self, message: str): method to_gradio_chatbot (line 173) | def to_gradio_chatbot(self): method to_openai_api_messages (line 183) | def to_openai_api_messages(self): method copy (line 196) | def copy(self): method dict (line 211) | def dict(self): function register_conv_template (line 225) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 235) | def get_conv_template(name: str) -> Conversation: FILE: xinference/thirdparty/deepseek_vl/utils/io.py function load_pretrained_model (line 30) | def load_pretrained_model(model_path: str): function load_pil_images (line 42) | def load_pil_images(conversations: List[Dict[str, str]]) -> List[PIL.Ima... function load_json (line 75) | def load_json(filepath): FILE: xinference/thirdparty/deepseek_vl2/models/configuration_deepseek.py class DeepseekV2Config (line 7) | class DeepseekV2Config(PretrainedConfig): method __init__ (line 117) | def __init__( FILE: xinference/thirdparty/deepseek_vl2/models/conversation.py class SeparatorStyle (line 10) | class SeparatorStyle(IntEnum): class Conversation (line 20) | class Conversation: method get_prompt (line 44) | def get_prompt(self) -> str: method set_system_message (line 106) | def set_system_message(self, system_message: str): method append_message (line 110) | def append_message(self, role: str, message: str): method update_last_message (line 114) | def update_last_message(self, message: str): method reset_message (line 122) | def reset_message(self): method to_gradio_chatbot (line 126) | def to_gradio_chatbot(self): method to_openai_api_messages (line 136) | def to_openai_api_messages(self): method copy (line 149) | def copy(self): method dict (line 164) | def dict(self): function register_conv_template (line 178) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 186) | def get_conv_template(name: str) -> Conversation: FILE: xinference/thirdparty/deepseek_vl2/models/modeling_deepseek.py function _get_unpad_data (line 80) | def _get_unpad_data(attention_mask): class DeepseekV2RMSNorm (line 94) | class DeepseekV2RMSNorm(nn.Module): method __init__ (line 95) | def __init__(self, hidden_size, eps=1e-6): method forward (line 103) | def forward(self, hidden_states): class DeepseekV2RotaryEmbedding (line 114) | class DeepseekV2RotaryEmbedding(nn.Module): method __init__ (line 115) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 134) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 146) | def forward(self, x, seq_len=None): class DeepseekV2LinearScalingRotaryEmbedding (line 158) | class DeepseekV2LinearScalingRotaryEmbedding(DeepseekV2RotaryEmbedding): method __init__ (line 161) | def __init__( method _set_cos_sin_cache (line 172) | def _set_cos_sin_cache(self, seq_len, device, dtype): class DeepseekV2DynamicNTKScalingRotaryEmbedding (line 187) | class DeepseekV2DynamicNTKScalingRotaryEmbedding(DeepseekV2RotaryEmbeddi... method __init__ (line 190) | def __init__( method _set_cos_sin_cache (line 201) | def _set_cos_sin_cache(self, seq_len, device, dtype): function yarn_find_correction_dim (line 226) | def yarn_find_correction_dim( function yarn_find_correction_range (line 235) | def yarn_find_correction_range( function yarn_get_mscale (line 247) | def yarn_get_mscale(scale=1, mscale=1): function yarn_linear_ramp_mask (line 253) | def yarn_linear_ramp_mask(min, max, dim): class DeepseekV2YarnRotaryEmbedding (line 262) | class DeepseekV2YarnRotaryEmbedding(DeepseekV2RotaryEmbedding): method __init__ (line 264) | def __init__( method _set_cos_sin_cache (line 285) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 331) | def rotate_half(x): function apply_rotary_pos_emb (line 339) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class DeepseekV2MLP (line 374) | class DeepseekV2MLP(nn.Module): method __init__ (line 375) | def __init__(self, config, hidden_size=None, intermediate_size=None): method forward (line 388) | def forward(self, x): class MoEGate (line 393) | class MoEGate(nn.Module): method __init__ (line 394) | def __init__(self, config): method reset_parameters (line 419) | def reset_parameters(self) -> None: method forward (line 424) | def forward(self, hidden_states): class AddAuxiliaryLoss (line 531) | class AddAuxiliaryLoss(torch.autograd.Function): method forward (line 538) | def forward(ctx, x, loss): method backward (line 545) | def backward(ctx, grad_output): class DeepseekV2MoE (line 552) | class DeepseekV2MoE(nn.Module): method __init__ (line 557) | def __init__(self, config): method forward (line 599) | def forward(self, hidden_states): method moe_infer (line 622) | def moe_infer(self, x, topk_ids, topk_weight): function repeat_kv (line 699) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class DeepseekV2Attention (line 714) | class DeepseekV2Attention(nn.Module): method __init__ (line 717) | def __init__(self, config: DeepseekV2Config, layer_idx: Optional[int] ... method _init_rope (line 784) | def _init_rope(self): method _shape (line 830) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 837) | def forward( class DeepseekV2FlashAttention2 (line 938) | class DeepseekV2FlashAttention2(DeepseekV2Attention): method __init__ (line 945) | def __init__(self, *args, **kwargs): method forward (line 953) | def forward( method _flash_attention_forward (line 1089) | def _flash_attention_forward( method _upad_input (line 1169) | def _upad_input( class DeepseekV2DecoderLayer (line 1227) | class DeepseekV2DecoderLayer(nn.Module): method __init__ (line 1228) | def __init__(self, config: DeepseekV2Config, layer_idx: int): method forward (line 1257) | def forward( class DeepseekV2PreTrainedModel (line 1341) | class DeepseekV2PreTrainedModel(PreTrainedModel): method _init_weights (line 1350) | def _init_weights(self, module): class DeepseekV2Model (line 1436) | class DeepseekV2Model(DeepseekV2PreTrainedModel): method __init__ (line 1444) | def __init__(self, config: DeepseekV2Config): method get_input_embeddings (line 1465) | def get_input_embeddings(self): method set_input_embeddings (line 1468) | def set_input_embeddings(self, value): method forward (line 1472) | def forward( class DeepseekV2ForCausalLM (line 1623) | class DeepseekV2ForCausalLM(DeepseekV2PreTrainedModel): method __init__ (line 1626) | def __init__(self, config): method get_input_embeddings (line 1635) | def get_input_embeddings(self): method set_input_embeddings (line 1638) | def set_input_embeddings(self, value): method get_output_embeddings (line 1641) | def get_output_embeddings(self): method set_output_embeddings (line 1644) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1647) | def set_decoder(self, decoder): method get_decoder (line 1650) | def get_decoder(self): method forward (line 1657) | def forward( method prepare_inputs_for_generation (line 1753) | def prepare_inputs_for_generation( method _reorder_cache (line 1834) | def _reorder_cache(past_key_values, beam_idx): class DeepseekV2ForSequenceClassification (line 1861) | class DeepseekV2ForSequenceClassification(DeepseekV2PreTrainedModel): method __init__ (line 1862) | def __init__(self, config): method get_input_embeddings (line 1871) | def get_input_embeddings(self): method set_input_embeddings (line 1874) | def set_input_embeddings(self, value): method forward (line 1878) | def forward( FILE: xinference/thirdparty/deepseek_vl2/models/modeling_deepseek_vl_v2.py class MlpProjector (line 34) | class MlpProjector(nn.Module): method __init__ (line 36) | def __init__(self, cfg): method forward (line 75) | def forward(self, x): class VisionEncoderConfig (line 115) | class VisionEncoderConfig(PretrainedConfig): method __init__ (line 134) | def __init__( class MlpProjectorConfig (line 166) | class MlpProjectorConfig(PretrainedConfig): method __init__ (line 176) | def __init__( class DeepSeekVLV2CausalLMOutputWithPast (line 197) | class DeepSeekVLV2CausalLMOutputWithPast(ModelOutput): class DeepseekVLV2Config (line 235) | class DeepseekVLV2Config(PretrainedConfig): method __init__ (line 245) | def __init__( class DeepseekVLV2PreTrainedModel (line 271) | class DeepseekVLV2PreTrainedModel(PreTrainedModel): class DeepseekVLV2ForCausalLM (line 278) | class DeepseekVLV2ForCausalLM(DeepseekVLV2PreTrainedModel): method __init__ (line 280) | def __init__(self, config: DeepseekVLV2Config): method prepare_inputs_embeds (line 336) | def prepare_inputs_embeds( method incremental_prefilling (line 480) | def incremental_prefilling( method forward (line 559) | def forward( method _clear_cuda_cache (line 623) | def _clear_cuda_cache(self): method _move_past_key_values_to_cpu (line 630) | def _move_past_key_values_to_cpu(self, past_key_values): method _move_past_key_values_to_gpu (line 636) | def _move_past_key_values_to_gpu(self, past_key_values, device="cuda:0"): method prepare_inputs_for_generation (line 642) | def prepare_inputs_for_generation( method _reorder_cache (line 682) | def _reorder_cache(past_key_values, beam_idx): FILE: xinference/thirdparty/deepseek_vl2/models/processing_deepseek_vl_v2.py function select_best_resolution (line 34) | def select_best_resolution(image_size, candidate_resolutions): class DictOutput (line 55) | class DictOutput(object): method keys (line 56) | def keys(self): method __getitem__ (line 59) | def __getitem__(self, item): method __setitem__ (line 62) | def __setitem__(self, key, value): class VLChatProcessorOutput (line 68) | class VLChatProcessorOutput(DictOutput): method __len__ (line 77) | def __len__(self): class BatchCollateOutput (line 82) | class BatchCollateOutput(DictOutput): method to (line 92) | def to(self, device, dtype=torch.bfloat16): class ImageTransform (line 102) | class ImageTransform(object): method __init__ (line 103) | def __init__( method __call__ (line 122) | def __call__(self, pil_img: Image.Image): class DeepseekVLV2Processor (line 128) | class DeepseekVLV2Processor(ProcessorMixin): method __init__ (line 132) | def __init__( method new_chat_template (line 210) | def new_chat_template(self): method format_messages (line 214) | def format_messages( method format_messages_v2 (line 240) | def format_messages_v2(self, messages, pil_images, systems=None): method format_prompts (line 324) | def format_prompts( method bos_id (line 352) | def bos_id(self): method eos_id (line 356) | def eos_id(self): method pad_id (line 360) | def pad_id(self): method encode (line 363) | def encode(self, text: str, bos: bool = True, eos: bool = False): method decode (line 373) | def decode(self, t: List[int], **kwargs) -> str: method process_one (line 376) | def process_one( method __call__ (line 476) | def __call__( method tokenize_with_images (line 523) | def tokenize_with_images( method batchify (line 599) | def batchify( FILE: xinference/thirdparty/deepseek_vl2/models/siglip_vit.py function _no_grad_trunc_normal_ (line 23) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 61) | def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): function init_weights (line 89) | def init_weights(self): function init_weights_vit_timm (line 95) | def init_weights_vit_timm(module: nn.Module, name: str = '') -> None: class Attention (line 105) | class Attention(nn.Module): method __init__ (line 108) | def __init__( method forward (line 135) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerScale (line 178) | class LayerScale(nn.Module): method __init__ (line 179) | def __init__( method forward (line 189) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 193) | class Block(nn.Module): method __init__ (line 194) | def __init__( method forward (line 235) | def forward(self, x: torch.Tensor) -> torch.Tensor: class VisionTransformer (line 241) | class VisionTransformer(nn.Module): method __init__ (line 249) | def __init__( method init_weights (line 404) | def init_weights(self, mode: Literal['jax', 'jax_nlhb', 'moco', ''] = ... method no_weight_decay (line 413) | def no_weight_decay(self) -> Set: method group_matcher (line 417) | def group_matcher(self, coarse: bool = False) -> Dict: method set_grad_checkpointing (line 424) | def set_grad_checkpointing(self, enable: bool = True) -> None: method get_classifier (line 428) | def get_classifier(self) -> nn.Module: method reset_classifier (line 431) | def reset_classifier(self, num_classes: int, global_pool=None) -> None: method _pos_embed (line 442) | def _pos_embed(self, x: torch.Tensor) -> torch.Tensor: method _intermediate_layers (line 475) | def _intermediate_layers( method get_intermediate_layers (line 495) | def get_intermediate_layers( method forward_features (line 524) | def forward_features(self, x: torch.Tensor) -> torch.Tensor: method forward_head (line 539) | def forward_head(self, x: torch.Tensor, pre_logits: bool = False) -> t... method forward (line 552) | def forward(self, x: torch.Tensor) -> torch.Tensor: method to_pipeline (line 558) | def to_pipeline(self, pp_size, pp_rank, pp_splits: Optional[List[int]]... class SigLIPVisionCfg (line 573) | class SigLIPVisionCfg: function create_siglip_vit (line 622) | def create_siglip_vit( FILE: xinference/thirdparty/deepseek_vl2/serve/app_modules/gradio_utils.py function wrap_gen_fn (line 25) | def wrap_gen_fn(gen_fn): function delete_last_conversation (line 38) | def delete_last_conversation(chatbot, history): function reset_state (line 61) | def reset_state(): function reset_textbox (line 65) | def reset_textbox(): function cancel_outputing (line 69) | def cancel_outputing(): class State (line 73) | class State: method interrupt (line 76) | def interrupt(self): method recover (line 79) | def recover(self): FILE: xinference/thirdparty/deepseek_vl2/serve/app_modules/overwrites.py function compact_text_chunks (line 29) | def compact_text_chunks(self, prompt, text_chunks: List[str]) -> List[str]: function postprocess (line 39) | def postprocess( function reload_javascript (line 68) | def reload_javascript(): FILE: xinference/thirdparty/deepseek_vl2/serve/app_modules/utils.py function configure_logger (line 48) | def configure_logger(): function strip_stop_words (line 74) | def strip_stop_words(x, stop_words): function format_output (line 81) | def format_output(history, text, x): function markdown_to_html_with_syntax_highlight (line 87) | def markdown_to_html_with_syntax_highlight(md_str): # deprecated function normalize_markdown (line 109) | def normalize_markdown(md_text: str) -> str: # deprecated function convert_mdtext (line 133) | def convert_mdtext(md_text): function convert_asis (line 156) | def convert_asis(userinput): function is_stop_word_or_prefix (line 160) | def is_stop_word_or_prefix(s: str, stop_words: list) -> bool: function detect_converted_mark (line 164) | def detect_converted_mark(userinput): function detect_language (line 168) | def detect_language(code): function convert_to_markdown (line 175) | def convert_to_markdown(text): function add_language_tag (line 212) | def add_language_tag(text): function is_variable_assigned (line 236) | def is_variable_assigned(var_name: str) -> bool: function pil_to_base64 (line 240) | def pil_to_base64( function parse_ref_bbox (line 270) | def parse_ref_bbox(response, image: Image.Image): function display_example (line 316) | def display_example(image_list): FILE: xinference/thirdparty/deepseek_vl2/serve/assets/Kelpy-Codos.js function addCopyButton (line 36) | function addCopyButton(pre) { function handleNewElements (line 81) | function handleNewElements(mutationsList, observer) { FILE: xinference/thirdparty/deepseek_vl2/serve/inference.py function load_model (line 36) | def load_model(model_path, dtype=torch.bfloat16): function convert_conversation_to_prompts (line 47) | def convert_conversation_to_prompts(conversation: Conversation): class StoppingCriteriaSub (line 72) | class StoppingCriteriaSub(StoppingCriteria): method __init__ (line 73) | def __init__(self, stops=[], encounters=1): method __call__ (line 77) | def __call__( function deepseek_generate (line 90) | def deepseek_generate( function generate (line 130) | def generate( FILE: xinference/thirdparty/deepseek_vl2/utils/io.py function load_pretrained_model (line 28) | def load_pretrained_model(model_path: str): function load_pil_images (line 44) | def load_pil_images(conversations: List[Dict[str, str]]) -> List[PIL.Ima... function load_json (line 77) | def load_json(filepath): FILE: xinference/thirdparty/f5_tts/api.py class F5TTS (line 24) | class F5TTS: method __init__ (line 25) | def __init__( method load_vocoder_model (line 58) | def load_vocoder_model(self, vocoder_name, local_path=None, hf_cache_d... method load_ema_model (line 61) | def load_ema_model(self, model_type, ckpt_file, mel_spec_type, vocab_f... method transcribe (line 88) | def transcribe(self, ref_audio, language=None): method export_wav (line 91) | def export_wav(self, wav, file_wave, remove_silence=False): method export_spectrogram (line 97) | def export_spectrogram(self, spect, file_spect): method infer (line 100) | def infer( FILE: xinference/thirdparty/f5_tts/eval/ecapa_tdnn.py class Res2Conv1dReluBn (line 16) | class Res2Conv1dReluBn(nn.Module): method __init__ (line 21) | def __init__(self, channels, kernel_size=1, stride=1, padding=0, dilat... method forward (line 36) | def forward(self, x): class Conv1dReluBn (line 59) | class Conv1dReluBn(nn.Module): method __init__ (line 60) | def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,... method forward (line 65) | def forward(self, x): class SE_Connect (line 73) | class SE_Connect(nn.Module): method __init__ (line 74) | def __init__(self, channels, se_bottleneck_dim=128): method forward (line 79) | def forward(self, x): class SE_Res2Block (line 100) | class SE_Res2Block(nn.Module): method __init__ (line 101) | def __init__(self, in_channels, out_channels, kernel_size, stride, pad... method forward (line 116) | def forward(self, x): class AttentiveStatsPool (line 133) | class AttentiveStatsPool(nn.Module): method __init__ (line 134) | def __init__(self, in_dim, attention_channels=128, global_context_att=... method forward (line 145) | def forward(self, x): class ECAPA_TDNN (line 163) | class ECAPA_TDNN(nn.Module): method __init__ (line 164) | def __init__( method get_feat_num (line 259) | def get_feat_num(self): method get_feat (line 270) | def get_feat(self, x): method forward (line 296) | def forward(self, x): function ECAPA_TDNN_SMALL (line 312) | def ECAPA_TDNN_SMALL( FILE: xinference/thirdparty/f5_tts/eval/eval_infer_batch.py function main (line 40) | def main(): FILE: xinference/thirdparty/f5_tts/eval/eval_librispeech_test_clean.py function get_args (line 23) | def get_args(): function main (line 34) | def main(): FILE: xinference/thirdparty/f5_tts/eval/eval_seedtts_testset.py function get_args (line 23) | def get_args(): function main (line 33) | def main(): FILE: xinference/thirdparty/f5_tts/eval/utils_eval.py function get_seedtts_testset_metainfo (line 17) | def get_seedtts_testset_metainfo(metalst): function get_librispeech_test_clean_metainfo (line 35) | def get_librispeech_test_clean_metainfo(metalst, librispeech_test_clean_... function padded_mel_batch (line 57) | def padded_mel_batch(ref_mels): function get_inference_prompt (line 71) | def get_inference_prompt( function get_seed_tts_test (line 210) | def get_seed_tts_test(metalst, gen_wav_dir, gpus): function get_librispeech_test (line 245) | def get_librispeech_test(metalst, gen_wav_dir, gpus, librispeech_test_cl... function load_asr_model (line 282) | def load_asr_model(lang, ckpt_dir=""): function run_asr_wer (line 304) | def run_asr_wer(args): function run_sim (line 371) | def run_sim(args): FILE: xinference/thirdparty/f5_tts/infer/infer_cli.py function main_process (line 166) | def main_process(ref_audio, ref_text, text_gen, model_obj, mel_spec_type... function main (line 221) | def main(): FILE: xinference/thirdparty/f5_tts/infer/infer_gradio.py function gpu_decorator (line 25) | def gpu_decorator(func): function load_f5tts (line 52) | def load_f5tts(ckpt_path=str(cached_path("hf://SWivid/F5-TTS/F5TTS_Base/... function load_e2tts (line 57) | def load_e2tts(ckpt_path=str(cached_path("hf://SWivid/E2-TTS/E2TTS_Base/... function load_custom (line 62) | def load_custom(ckpt_path: str, vocab_path="", model_cfg=None): function generate_response (line 82) | def generate_response(messages, model, tokenizer): function infer (line 105) | def infer( function basic_tts (line 200) | def basic_tts( function parse_speechtypes_text (line 233) | def parse_speechtypes_text(gen_text): function add_speech_type_fn (line 335) | def add_speech_type_fn(speech_type_count): function make_delete_speech_type_fn (line 355) | def make_delete_speech_type_fn(index): function make_insert_speech_type_fn (line 384) | def make_insert_speech_type_fn(index): function generate_multistyle_speech (line 414) | def generate_multistyle_speech( function validate_speech_types (line 489) | def validate_speech_types(gen_text, regular_name, *args): function load_chat_model (line 539) | def load_chat_model(): function process_audio_input (line 612) | def process_audio_input(audio_path, text, history, conv_state): function generate_audio_response (line 635) | def generate_audio_response(history, ref_audio, ref_text, remove_silence): function clear_conversation (line 656) | def clear_conversation(): function update_system_prompt (line 665) | def update_system_prompt(new_prompt): function load_last_used_custom (line 749) | def load_last_used_custom(): function switch_tts_model (line 760) | def switch_tts_model(new_choice): function set_custom_model (line 770) | def set_custom_model(custom_ckpt_path, custom_vocab_path): function main (line 841) | def main(port, host, share, api, root_path): FILE: xinference/thirdparty/f5_tts/infer/utils_infer.py function chunk_text (line 61) | def chunk_text(text, max_chars=135): function load_vocoder (line 92) | def load_vocoder(vocoder_name="vocos", is_local=False, local_path="", de... function initialize_asr_pipeline (line 138) | def initialize_asr_pipeline(device: str = device, dtype=None): function transcribe (line 155) | def transcribe(ref_audio, language=None): function load_checkpoint (line 171) | def load_checkpoint(model, ckpt_path, device: str, dtype=None, use_ema=T... function load_model (line 215) | def load_model( function remove_silence_edges (line 256) | def remove_silence_edges(audio, silence_threshold=-42): function preprocess_ref_audio_text (line 275) | def preprocess_ref_audio_text(ref_audio_orig, ref_text, clip_short=True,... function infer_process (line 349) | def infer_process( function infer_batch_process (line 397) | def infer_batch_process( function remove_silence_for_generated_wav (line 518) | def remove_silence_for_generated_wav(filename): function save_spectrogram (line 533) | def save_spectrogram(spectrogram, path): FILE: xinference/thirdparty/f5_tts/model/backbones/dit.py class TextEmbedding (line 32) | class TextEmbedding(nn.Module): method __init__ (line 33) | def __init__(self, text_num_embeds, text_dim, conv_layers=0, conv_mult... method forward (line 47) | def forward(self, text: int["b nt"], seq_len, drop_text=False): # noq... class InputEmbedding (line 75) | class InputEmbedding(nn.Module): method __init__ (line 76) | def __init__(self, mel_dim, text_dim, out_dim): method forward (line 81) | def forward(self, x: float["b n d"], cond: float["b n d"], text_embed:... class DiT (line 93) | class DiT(nn.Module): method __init__ (line 94) | def __init__( method forward (line 130) | def forward( FILE: xinference/thirdparty/f5_tts/model/backbones/mmdit.py class TextEmbedding (line 30) | class TextEmbedding(nn.Module): method __init__ (line 31) | def __init__(self, out_dim, text_num_embeds): method forward (line 38) | def forward(self, text: int["b nt"], drop_text=False) -> int["b nt d"]... class AudioEmbedding (line 58) | class AudioEmbedding(nn.Module): method __init__ (line 59) | def __init__(self, in_dim, out_dim): method forward (line 64) | def forward(self, x: float["b n d"], cond: float["b n d"], drop_audio_... class MMDiT (line 76) | class MMDiT(nn.Module): method __init__ (line 77) | def __init__( method forward (line 116) | def forward( FILE: xinference/thirdparty/f5_tts/model/backbones/unett.py class TextEmbedding (line 35) | class TextEmbedding(nn.Module): method __init__ (line 36) | def __init__(self, text_num_embeds, text_dim, conv_layers=0, conv_mult... method forward (line 50) | def forward(self, text: int["b nt"], seq_len, drop_text=False): # noq... class InputEmbedding (line 78) | class InputEmbedding(nn.Module): method __init__ (line 79) | def __init__(self, mel_dim, text_dim, out_dim): method forward (line 84) | def forward(self, x: float["b n d"], cond: float["b n d"], text_embed:... class UNetT (line 96) | class UNetT(nn.Module): method __init__ (line 97) | def __init__( method forward (line 164) | def forward( FILE: xinference/thirdparty/f5_tts/model/cfm.py class CFM (line 32) | class CFM(nn.Module): method __init__ (line 33) | def __init__( method device (line 78) | def device(self): method sample (line 82) | def sample( method forward (line 212) | def forward( FILE: xinference/thirdparty/f5_tts/model/dataset.py class HFDataset (line 18) | class HFDataset(Dataset): method __init__ (line 19) | def __init__( method get_frame_len (line 42) | def get_frame_len(self, index): method __len__ (line 48) | def __len__(self): method __getitem__ (line 51) | def __getitem__(self, index): class CustomDataset (line 83) | class CustomDataset(Dataset): method __init__ (line 84) | def __init__( method get_frame_len (line 119) | def get_frame_len(self, index): method __len__ (line 126) | def __len__(self): method __getitem__ (line 129) | def __getitem__(self, index): class DynamicBatchSampler (line 167) | class DynamicBatchSampler(Sampler[list[int]]): method __init__ (line 175) | def __init__( method __iter__ (line 222) | def __iter__(self): method __len__ (line 225) | def __len__(self): function load_dataset (line 232) | def load_dataset( function collate_fn (line 298) | def collate_fn(batch): FILE: xinference/thirdparty/f5_tts/model/modules.py function get_bigvgan_mel_spectrogram (line 30) | def get_bigvgan_mel_spectrogram( function get_vocos_mel_spectrogram (line 75) | def get_vocos_mel_spectrogram( class MelSpec (line 104) | class MelSpec(nn.Module): method __init__ (line 105) | def __init__( method forward (line 130) | def forward(self, wav): class SinusPositionEmbedding (line 149) | class SinusPositionEmbedding(nn.Module): method __init__ (line 150) | def __init__(self, dim): method forward (line 154) | def forward(self, x, scale=1000): class ConvPositionEmbedding (line 167) | class ConvPositionEmbedding(nn.Module): method __init__ (line 168) | def __init__(self, dim, kernel_size=31, groups=16): method forward (line 178) | def forward(self, x: float["b n d"], mask: bool["b n"] | None = None):... function precompute_freqs_cis (line 196) | def precompute_freqs_cis(dim: int, end: int, theta: float = 10000.0, the... function get_pos_embed_indices (line 210) | def get_pos_embed_indices(start, length, max_pos, scale=1.0): class GRN (line 225) | class GRN(nn.Module): method __init__ (line 226) | def __init__(self, dim): method forward (line 231) | def forward(self, x): class ConvNeXtV2Block (line 241) | class ConvNeXtV2Block(nn.Module): method __init__ (line 242) | def __init__( method forward (line 259) | def forward(self, x: torch.Tensor) -> torch.Tensor: class AdaLayerNormZero (line 276) | class AdaLayerNormZero(nn.Module): method __init__ (line 277) | def __init__(self, dim): method forward (line 285) | def forward(self, x, emb=None): class AdaLayerNormZero_Final (line 297) | class AdaLayerNormZero_Final(nn.Module): method __init__ (line 298) | def __init__(self, dim): method forward (line 306) | def forward(self, x, emb): class FeedForward (line 317) | class FeedForward(nn.Module): method __init__ (line 318) | def __init__(self, dim, dim_out=None, mult=4, dropout=0.0, approximate... method forward (line 327) | def forward(self, x): class Attention (line 335) | class Attention(nn.Module): method __init__ (line 336) | def __init__( method forward (line 378) | def forward( class AttnProcessor (line 395) | class AttnProcessor: method __init__ (line 396) | def __init__(self): method __call__ (line 399) | def __call__( class JointAttnProcessor (line 456) | class JointAttnProcessor: method __init__ (line 457) | def __init__(self): method __call__ (line 460) | def __call__( class DiTBlock (line 542) | class DiTBlock(nn.Module): method __init__ (line 543) | def __init__(self, dim, heads, dim_head, ff_mult=4, dropout=0.1): method forward (line 558) | def forward(self, x, t, mask=None, rope=None): # x: noised input, t: ... class MMDiTBlock (line 578) | class MMDiTBlock(nn.Module): method __init__ (line 588) | def __init__(self, dim, heads, dim_head, ff_mult=4, dropout=0.1, conte... method forward (line 614) | def forward(self, x, c, t, mask=None, rope=None, c_rope=None): # x: n... class TimestepEmbedding (line 648) | class TimestepEmbedding(nn.Module): method __init__ (line 649) | def __init__(self, dim, freq_embed_dim=256): method forward (line 654) | def forward(self, timestep: float["b"]): # noqa: F821 FILE: xinference/thirdparty/f5_tts/model/trainer.py class Trainer (line 24) | class Trainer: method __init__ (line 25) | def __init__( method is_main (line 132) | def is_main(self): method save_checkpoint (line 135) | def save_checkpoint(self, step, last=False): method load_checkpoint (line 153) | def load_checkpoint(self): method train (line 204) | def train(self, train_dataset: Dataset, num_workers=16, resumable_with... FILE: xinference/thirdparty/f5_tts/model/utils.py function seed_everything (line 18) | def seed_everything(seed=0): function exists (line 31) | def exists(v): function default (line 35) | def default(v, d): function lens_to_mask (line 42) | def lens_to_mask(t: int["b"], length: int | None = None) -> bool["b n"]:... function mask_from_start_end_indices (line 50) | def mask_from_start_end_indices(seq_len: int["b"], start: int["b"], end:... function mask_from_frac_lengths (line 58) | def mask_from_frac_lengths(seq_len: int["b"], frac_lengths: float["b"]):... function maybe_masked_mean (line 69) | def maybe_masked_mean(t: float["b n d"], mask: bool["b n"] = None) -> fl... function list_str_to_tensor (line 81) | def list_str_to_tensor(text: list[str], padding_value=-1) -> int["b nt"]... function list_str_to_idx (line 88) | def list_str_to_idx( function get_tokenizer (line 101) | def get_tokenizer(dataset_name, tokenizer: str = "pinyin"): function convert_char_to_pinyin (line 137) | def convert_char_to_pinyin(text_list, polyphone=True): function repetition_found (line 177) | def repetition_found(text, length=2, tolerance=10): FILE: xinference/thirdparty/f5_tts/socket_server.py class TTSStreamingProcessor (line 16) | class TTSStreamingProcessor: method __init__ (line 17) | def __init__(self, ckpt_file, vocab_file, ref_audio, ref_text, device=... method _warm_up (line 45) | def _warm_up(self): method generate_stream (line 56) | def generate_stream(self, text, play_steps_in_s=0.5): function handle_client (line 95) | def handle_client(client_socket, processor): function start_server (line 126) | def start_server(host, port, processor): FILE: xinference/thirdparty/f5_tts/train/datasets/prepare_csv_wavs.py function is_csv_wavs_format (line 25) | def is_csv_wavs_format(input_dataset_dir): function prepare_csv_wavs_dir (line 32) | def prepare_csv_wavs_dir(input_dir): function get_audio_duration (line 55) | def get_audio_duration(audio_path): function read_audio_text_pairs (line 60) | def read_audio_text_pairs(csv_file_path): function save_prepped_dataset (line 77) | def save_prepped_dataset(out_dir, result, duration_list, text_vocab_set,... function prepare_and_save_set (line 118) | def prepare_and_save_set(inp_dir, out_dir, is_finetune: bool = True): function cli (line 125) | def cli(): FILE: xinference/thirdparty/f5_tts/train/datasets/prepare_emilia.py function deal_with_audio_dir (line 113) | def deal_with_audio_dir(audio_dir): function main (line 149) | def main(): FILE: xinference/thirdparty/f5_tts/train/datasets/prepare_libritts.py function deal_with_audio_dir (line 15) | def deal_with_audio_dir(audio_dir): function main (line 32) | def main(): FILE: xinference/thirdparty/f5_tts/train/datasets/prepare_ljspeech.py function main (line 14) | def main(): FILE: xinference/thirdparty/f5_tts/train/datasets/prepare_wenetspeech4tts.py function deal_with_sub_path_files (line 20) | def deal_with_sub_path_files(dataset_path, sub_path): function main (line 48) | def main(): FILE: xinference/thirdparty/f5_tts/train/finetune_cli.py function parse_args (line 22) | def parse_args(): function main (line 81) | def main(): FILE: xinference/thirdparty/f5_tts/train/finetune_gradio.py function save_settings (line 53) | def save_settings( function load_settings (line 104) | def load_settings(project_name): function get_audio_duration (line 180) | def get_audio_duration(audio_path): function clear_text (line 186) | def clear_text(text): function get_rms (line 191) | def get_rms( class Slicer (line 224) | class Slicer: # https://github.com/RVC-Boss/GPT-SoVITS/blob/main/tools/... method __init__ (line 225) | def __init__( method _apply_slice (line 246) | def _apply_slice(self, waveform, begin, end): method slice (line 253) | def slice(self, waveform): function terminate_process_tree (line 342) | def terminate_process_tree(pid, including_parent=True): function terminate_process (line 362) | def terminate_process(pid): function start_training (line 370) | def start_training( function stop_training (line 617) | def stop_training(): function get_list_projects (line 628) | def get_list_projects(): function create_data_project (line 644) | def create_data_project(name, tokenizer_type): function transcribe_all (line 652) | def transcribe_all(name_project, audio_files, language, user=False, prog... function format_seconds_to_hms (line 723) | def format_seconds_to_hms(seconds): function get_correct_audio_path (line 730) | def get_correct_audio_path( function create_metadata (line 761) | def create_metadata(name_project, ch_tokenizer, progress=gr.Progress()): function check_user (line 871) | def check_user(value): function calculate_train (line 875) | def calculate_train( function extract_and_save_ema_model (line 987) | def extract_and_save_ema_model(checkpoint_path: str, new_checkpoint_path... function expand_model_embeddings (line 1010) | def expand_model_embeddings(ckpt_path, new_ckpt_path, num_new_tokens=42): function vocab_count (line 1043) | def vocab_count(text): function vocab_extend (line 1047) | def vocab_extend(project_name, symbols, model_type): function vocab_check (line 1106) | def vocab_check(project_name): function get_random_sample_prepare (line 1151) | def get_random_sample_prepare(project_name): function get_random_sample_transcribe (line 1164) | def get_random_sample_transcribe(project_name): function get_random_sample_infer (line 1193) | def get_random_sample_infer(project_name): function infer (line 1202) | def infer( function check_finetune (line 1247) | def check_finetune(finetune): function get_checkpoints_project (line 1251) | def get_checkpoints_project(project_name, is_gradio=True): function get_audio_project (line 1275) | def get_audio_project(project_name, is_gradio=True): function get_gpu_stats (line 1296) | def get_gpu_stats(): function get_cpu_stats (line 1336) | def get_cpu_stats(): function get_combined_stats (line 1356) | def get_combined_stats(): function get_audio_select (line 1363) | def get_audio_select(file_sample): function setup_load_settings (line 1703) | def setup_load_settings(): function update_stats (line 1816) | def update_stats(): function auto_update (line 1822) | def auto_update(): function main (line 1839) | def main(port, host, share, api): FILE: xinference/thirdparty/f5_tts/train/train.py function main (line 16) | def main(cfg): FILE: xinference/thirdparty/fish_speech/fish_speech/callbacks/grad_norm.py function grad_norm (line 15) | def grad_norm( class GradNormMonitor (line 55) | class GradNormMonitor(Callback): method __init__ (line 60) | def __init__( method on_after_backward (line 77) | def on_after_backward(self, trainer: Trainer, model: LightningModule) ... method log_sub_module_grad_norm (line 100) | def log_sub_module_grad_norm( FILE: xinference/thirdparty/fish_speech/fish_speech/conversation.py class BasePart (line 12) | class BasePart: class VQPart (line 17) | class VQPart(BasePart): class TextPart (line 22) | class TextPart(BasePart): class EncodedMessage (line 27) | class EncodedMessage: class Message (line 37) | class Message: method encode (line 48) | def encode( class Conversation (line 116) | class Conversation: method __init__ (line 119) | def __init__(self: "Conversation", messages: list[Message] | None = No... method encode (line 122) | def encode( method encode_for_inference (line 178) | def encode_for_inference( method visualize (line 201) | def visualize( method append (line 242) | def append(self: "Conversation", message: Message): FILE: xinference/thirdparty/fish_speech/fish_speech/datasets/concat_repeat.py class ConcatRepeatDataset (line 8) | class ConcatRepeatDataset(Dataset): method cumsum (line 14) | def cumsum(sequence, repeats): method __init__ (line 22) | def __init__(self, datasets: Iterable[Dataset], repeats: list[int]): method __len__ (line 40) | def __len__(self): method __getitem__ (line 43) | def __getitem__(self, idx): FILE: xinference/thirdparty/fish_speech/fish_speech/datasets/protos/text_data_stream.py function read_pb_stream (line 6) | def read_pb_stream(f): function write_pb_stream (line 18) | def write_pb_stream(f, text_data): function pack_pb_stream (line 24) | def pack_pb_stream(text_data): function split_pb_stream (line 29) | def split_pb_stream(f): FILE: xinference/thirdparty/fish_speech/fish_speech/datasets/semantic.py function split_by_rank_worker (line 29) | def split_by_rank_worker(files): class AutoTextSemanticInstructionDataset (line 56) | class AutoTextSemanticInstructionDataset(IterableDataset): method __init__ (line 70) | def __init__( method init_mock_data_server (line 112) | def init_mock_data_server(self): method __iter__ (line 151) | def __iter__(self): method tokenize_sentence (line 155) | def tokenize_sentence(self, sentence: str): method sample_data (line 165) | def sample_data(self): method augment (line 193) | def augment(self): method pack_sentences (line 269) | def pack_sentences( class TextDataCollator (line 340) | class TextDataCollator: method __call__ (line 344) | def __call__(self, examples): method batchify (line 367) | def batchify(self, examples, tokens_key="tokens", labels_key="labels"): class InterleaveDataset (line 413) | class InterleaveDataset(IterableDataset): method __init__ (line 414) | def __init__( method __iter__ (line 426) | def __iter__(self): class SemanticDataModule (line 443) | class SemanticDataModule(LightningDataModule): method __init__ (line 444) | def __init__( method train_dataloader (line 462) | def train_dataloader(self): method val_dataloader (line 471) | def val_dataloader(self): FILE: xinference/thirdparty/fish_speech/fish_speech/datasets/vqgan.py class VQGANDataset (line 16) | class VQGANDataset(Dataset): method __init__ (line 17) | def __init__( method __len__ (line 38) | def __len__(self): method get_item (line 41) | def get_item(self, idx): method __getitem__ (line 67) | def __getitem__(self, idx): class VQGANCollator (line 79) | class VQGANCollator: method __call__ (line 80) | def __call__(self, batch): class VQGANDataModule (line 99) | class VQGANDataModule(LightningDataModule): method __init__ (line 100) | def __init__( method train_dataloader (line 116) | def train_dataloader(self): method val_dataloader (line 126) | def val_dataloader(self): FILE: xinference/thirdparty/fish_speech/fish_speech/i18n/core.py function load_language_list (line 9) | def load_language_list(language): class I18nAuto (line 16) | class I18nAuto: method __init__ (line 17) | def __init__(self): method __call__ (line 33) | def __call__(self, key): method __repr__ (line 36) | def __repr__(self): FILE: xinference/thirdparty/fish_speech/fish_speech/i18n/scan.py function extract_i18n_strings (line 12) | def extract_i18n_strings(node): FILE: xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/lit_module.py class TextToSemantic (line 15) | class TextToSemantic(L.LightningModule): method __init__ (line 16) | def __init__( method forward (line 28) | def forward(self, x): method on_save_checkpoint (line 31) | def on_save_checkpoint(self, checkpoint): method configure_optimizers (line 42) | def configure_optimizers(self) -> OptimizerLRScheduler: method get_batch_logps (line 75) | def get_batch_logps( method _step (line 108) | def _step(self, batch, batch_idx, stage: str): method get_accuracy (line 185) | def get_accuracy(self, logits, labels): method training_step (line 198) | def training_step(self, batch, batch_idx): method validation_step (line 201) | def validation_step(self, batch, batch_idx): FILE: xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/llama.py function find_multiple (line 27) | def find_multiple(n: int, k: int) -> int: class BaseModelArgs (line 34) | class BaseModelArgs: method __post_init__ (line 66) | def __post_init__(self): method from_pretrained (line 76) | def from_pretrained(path: str): method save (line 95) | def save(self, path: str): class NaiveModelArgs (line 101) | class NaiveModelArgs(BaseModelArgs): class DualARModelArgs (line 106) | class DualARModelArgs(BaseModelArgs): method __post_init__ (line 116) | def __post_init__(self): class KVCache (line 133) | class KVCache(nn.Module): method __init__ (line 134) | def __init__( method update (line 142) | def update(self, input_pos, k_val, v_val): class TransformerForwardResult (line 155) | class TransformerForwardResult: class BaseTransformerForwardResult (line 161) | class BaseTransformerForwardResult: class BaseTransformer (line 166) | class BaseTransformer(nn.Module): method __init__ (line 167) | def __init__( method setup_caches (line 229) | def setup_caches( method embed (line 249) | def embed(self, x: Tensor) -> Tensor: method forward (line 263) | def forward( method forward_generate (line 302) | def forward_generate( method _init_weights (line 367) | def _init_weights(self, module): method from_pretrained (line 379) | def from_pretrained( method save_pretrained (line 475) | def save_pretrained(self, path: str, drop_lora: bool = False): class NaiveTransformer (line 494) | class NaiveTransformer(BaseTransformer): method __init__ (line 495) | def __init__(self, config: NaiveModelArgs, tokenizer: FishTokenizer) -... method decode (line 507) | def decode(self, result: BaseTransformerForwardResult) -> TransformerF... method forward (line 522) | def forward( method forward_generate (line 533) | def forward_generate( class DualARTransformer (line 540) | class DualARTransformer(BaseTransformer): method __init__ (line 541) | def __init__(self, config: NaiveModelArgs, tokenizer: FishTokenizer) -... method setup_caches (line 586) | def setup_caches( method forward (line 604) | def forward( method forward_generate_fast (line 676) | def forward_generate_fast( method forward_generate (line 696) | def forward_generate( class TransformerBlock (line 707) | class TransformerBlock(nn.Module): method __init__ (line 708) | def __init__(self, config: BaseModelArgs, use_sdpa: bool = True) -> None: method forward (line 715) | def forward( class Attention (line 723) | class Attention(nn.Module): method __init__ (line 724) | def __init__(self, config: BaseModelArgs, use_sdpa: bool = True): method load_hook (line 744) | def load_hook(self, state_dict, prefix, *args): method forward (line 751) | def forward( method eq_scaled_dot_product_attention (line 810) | def eq_scaled_dot_product_attention( class FeedForward (line 839) | class FeedForward(nn.Module): method __init__ (line 840) | def __init__(self, config: BaseModelArgs) -> None: method forward (line 846) | def forward(self, x: Tensor) -> Tensor: class RMSNorm (line 850) | class RMSNorm(nn.Module): method __init__ (line 851) | def __init__(self, dim: int, eps: float = 1e-5): method _norm (line 856) | def _norm(self, x): method forward (line 859) | def forward(self, x: Tensor) -> Tensor: function precompute_freqs_cis (line 864) | def precompute_freqs_cis(seq_len: int, n_elem: int, base: int = 10000) -... function apply_rotary_emb (line 875) | def apply_rotary_emb(x: Tensor, freqs_cis: Tensor) -> Tensor: FILE: xinference/thirdparty/fish_speech/fish_speech/models/text2semantic/lora.py class LoraConfig (line 7) | class LoraConfig: function setup_lora (line 13) | def setup_lora(model, lora_config): function get_merged_state_dict (line 82) | def get_merged_state_dict(model): FILE: xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/firefly.py function sequence_mask (line 14) | def sequence_mask(length, max_length=None): function init_weights (line 21) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 27) | def get_padding(kernel_size, dilation=1): function unpad1d (line 31) | def unpad1d(x: torch.Tensor, paddings: tuple[int, int]): function get_extra_padding_for_conv1d (line 40) | def get_extra_padding_for_conv1d( function pad1d (line 50) | def pad1d( class FishConvNet (line 76) | class FishConvNet(nn.Module): method __init__ (line 77) | def __init__( method forward (line 93) | def forward(self, x): method weight_norm (line 101) | def weight_norm(self, name="weight", dim=0): method remove_parametrizations (line 105) | def remove_parametrizations(self, name="weight"): class FishTransConvNet (line 110) | class FishTransConvNet(nn.Module): method __init__ (line 111) | def __init__(self, in_channels, out_channels, kernel_size, dilation=1,... method forward (line 119) | def forward(self, x): method weight_norm (line 127) | def weight_norm(self, name="weight", dim=0): method remove_parametrizations (line 131) | def remove_parametrizations(self, name="weight"): class ResBlock1 (line 136) | class ResBlock1(torch.nn.Module): method __init__ (line 137) | def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)): method forward (line 170) | def forward(self, x): method remove_parametrizations (line 179) | def remove_parametrizations(self): class ParallelBlock (line 186) | class ParallelBlock(nn.Module): method __init__ (line 187) | def __init__( method forward (line 201) | def forward(self, x): method remove_parametrizations (line 204) | def remove_parametrizations(self): class HiFiGANGenerator (line 209) | class HiFiGANGenerator(nn.Module): method __init__ (line 210) | def __init__( method forward (line 267) | def forward(self, x): method remove_parametrizations (line 289) | def remove_parametrizations(self): function drop_path (line 299) | def drop_path( class DropPath (line 324) | class DropPath(nn.Module): method __init__ (line 327) | def __init__(self, drop_prob: float = 0.0, scale_by_keep: bool = True): method forward (line 332) | def forward(self, x): method extra_repr (line 335) | def extra_repr(self): class LayerNorm (line 339) | class LayerNorm(nn.Module): method __init__ (line 346) | def __init__(self, normalized_shape, eps=1e-6, data_format="channels_l... method forward (line 356) | def forward(self, x): class ConvNeXtBlock (line 370) | class ConvNeXtBlock(nn.Module): method __init__ (line 385) | def __init__( method forward (line 416) | def forward(self, x, apply_residual: bool = True): class ConvNeXtEncoder (line 438) | class ConvNeXtEncoder(nn.Module): method __init__ (line 439) | def __init__( method _init_weights (line 494) | def _init_weights(self, m): method forward (line 499) | def forward( class FireflyArchitecture (line 510) | class FireflyArchitecture(nn.Module): method __init__ (line 511) | def __init__( method forward (line 526) | def forward(self, x: torch.Tensor, template=None, mask=None) -> torch.... method encode (line 551) | def encode(self, audios, audio_lengths): method decode (line 566) | def decode(self, indices, feature_lengths) -> torch.Tensor: method remove_parametrizations (line 587) | def remove_parametrizations(self): method device (line 595) | def device(self): FILE: xinference/thirdparty/fish_speech/fish_speech/models/vqgan/modules/fsq.py class FSQResult (line 13) | class FSQResult: class DownsampleFiniteScalarQuantize (line 19) | class DownsampleFiniteScalarQuantize(nn.Module): method __init__ (line 20) | def __init__( method _init_weights (line 78) | def _init_weights(self, m): method forward (line 83) | def forward(self, z) -> FSQResult: method encode (line 106) | def encode(self, z): method decode (line 112) | def decode(self, indices: torch.Tensor): FILE: xinference/thirdparty/fish_speech/fish_speech/models/vqgan/utils.py function convert_pad_shape (line 8) | def convert_pad_shape(pad_shape): function sequence_mask (line 14) | def sequence_mask(length, max_length=None): function init_weights (line 21) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 27) | def get_padding(kernel_size, dilation=1): function plot_mel (line 31) | def plot_mel(data, titles=None): function slice_segments (line 55) | def slice_segments(x, ids_str, segment_size=4): function rand_slice_segments (line 65) | def rand_slice_segments(x, x_lengths=None, segment_size=4): function fused_add_tanh_sigmoid_multiply (line 76) | def fused_add_tanh_sigmoid_multiply(in_act, n_channels): function avg_with_mask (line 85) | def avg_with_mask(x, mask): FILE: xinference/thirdparty/fish_speech/fish_speech/scheduler.py function get_cosine_schedule_with_warmup_lr_lambda (line 4) | def get_cosine_schedule_with_warmup_lr_lambda( function get_constant_schedule_with_warmup_lr_lambda (line 28) | def get_constant_schedule_with_warmup_lr_lambda( FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/basic_class.py class ChineseChar (line 18) | class ChineseChar(object): method __init__ (line 26) | def __init__(self, simplified, traditional): method __str__ (line 31) | def __str__(self): method __repr__ (line 34) | def __repr__(self): class ChineseNumberUnit (line 38) | class ChineseNumberUnit(ChineseChar): method __init__ (line 45) | def __init__(self, power, simplified, traditional, big_s, big_t): method __str__ (line 51) | def __str__(self): method create (line 55) | def create(cls, index, value, numbering_type=NUMBERING_TYPES[1], small... class ChineseNumberDigit (line 97) | class ChineseNumberDigit(ChineseChar): method __init__ (line 102) | def __init__( method __str__ (line 112) | def __str__(self): method create (line 116) | def create(cls, i, v): class ChineseMath (line 120) | class ChineseMath(ChineseChar): method __init__ (line 125) | def __init__(self, simplified, traditional, symbol, expression=None): class NumberSystem (line 136) | class NumberSystem(object): class MathSymbol (line 144) | class MathSymbol(object): method __init__ (line 152) | def __init__(self, positive, negative, point): method __iter__ (line 157) | def __iter__(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/basic_util.py function create_system (line 15) | def create_system(numbering_type=NUMBERING_TYPES[1]): function chn2num (line 66) | def chn2num(chinese_string, numbering_type=NUMBERING_TYPES[1]): function num2chn (line 171) | def num2chn( FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/cardinal.py class Cardinal (line 13) | class Cardinal: method __init__ (line 18) | def __init__(self, cardinal=None, chntext=None): method chntext2cardinal (line 22) | def chntext2cardinal(self): method cardinal2chntext (line 25) | def cardinal2chntext(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/date.py class Date (line 14) | class Date: method __init__ (line 19) | def __init__(self, date=None, chntext=None): method date2chntext (line 47) | def date2chntext(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/digit.py class Digit (line 13) | class Digit: method __init__ (line 18) | def __init__(self, digit=None, chntext=None): method digit2chntext (line 25) | def digit2chntext(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/fraction.py class Fraction (line 13) | class Fraction: method __init__ (line 18) | def __init__(self, fraction=None, chntext=None): method chntext2fraction (line 22) | def chntext2fraction(self): method fraction2chntext (line 26) | def fraction2chntext(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/money.py class Money (line 14) | class Money: method __init__ (line 19) | def __init__(self, money=None, chntext=None): method money2chntext (line 26) | def money2chntext(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/percentage.py class Percentage (line 13) | class Percentage: method __init__ (line 18) | def __init__(self, percentage=None, chntext=None): method chntext2percentage (line 22) | def chntext2percentage(self): method percentage2chntext (line 25) | def percentage2chntext(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/telephone.py class TelePhone (line 13) | class TelePhone: method __init__ (line 18) | def __init__(self, telephone=None, raw_chntext=None, chntext=None): method telephone2chntext (line 30) | def telephone2chntext(self, fixed=False): FILE: xinference/thirdparty/fish_speech/fish_speech/text/chn_text_norm/text.py class Text (line 34) | class Text: method __init__ (line 39) | def __init__(self, raw_text, norm_text=None): method _particular (line 43) | def _particular(self): method normalize (line 54) | def normalize(self): FILE: xinference/thirdparty/fish_speech/fish_speech/text/clean.py function clean_text (line 24) | def clean_text(text): FILE: xinference/thirdparty/fish_speech/fish_speech/text/spliter.py function utf_8_len (line 7) | def utf_8_len(text: str): function break_text (line 11) | def break_text(texts, length, splits: set): function break_text_by_length (line 29) | def break_text_by_length(texts, length): function add_cleaned (line 47) | def add_cleaned(curr, segments): function protect_float (line 53) | def protect_float(text): function unprotect_float (line 58) | def unprotect_float(text): function split_text (line 63) | def split_text(text, length): FILE: xinference/thirdparty/fish_speech/fish_speech/tokenizer.py class FishTokenizer (line 65) | class FishTokenizer: method __init__ (line 66) | def __init__(self, model_path: str) -> None: method load_tiktoken_bpe (line 87) | def load_tiktoken_bpe(tiktoken_bpe_file: str) -> dict[bytes, int]: method get_token_id (line 96) | def get_token_id(self, token: str) -> int: method encode (line 99) | def encode(self, s: str, allowed_special: bool | set[str] = True) -> l... method decode (line 118) | def decode(self, tokens: list[int]) -> str: method save_pretrained (line 121) | def save_pretrained(self, path: str): method from_pretrained (line 138) | def from_pretrained(path: str): FILE: xinference/thirdparty/fish_speech/fish_speech/train.py function train (line 36) | def train(cfg: DictConfig) -> tuple[dict, dict]: function main (line 135) | def main(cfg: DictConfig) -> Optional[float]: FILE: xinference/thirdparty/fish_speech/fish_speech/utils/braceexpand.py class UnbalancedBracesError (line 15) | class UnbalancedBracesError(ValueError): function braceexpand (line 26) | def braceexpand(pattern: str, escape: bool = True) -> Iterator[str]: function parse_pattern (line 105) | def parse_pattern(pattern: str, escape: bool) -> Iterator[str]: function parse_expression (line 144) | def parse_expression(expr: str, escape: bool) -> Optional[Iterable[str]]: function parse_sequence (line 156) | def parse_sequence(seq: str, escape: bool) -> Optional[Iterator[str]]: function make_int_range (line 187) | def make_int_range(left: str, right: str, incr: Optional[str] = None) ->... function make_char_range (line 200) | def make_char_range(left: str, right: str, incr: Optional[str] = None) -... FILE: xinference/thirdparty/fish_speech/fish_speech/utils/context.py function autocast_exclude_mps (line 6) | def autocast_exclude_mps( FILE: xinference/thirdparty/fish_speech/fish_speech/utils/file.py function get_latest_checkpoint (line 5) | def get_latest_checkpoint(path: Path | str) -> Path | None: FILE: xinference/thirdparty/fish_speech/fish_speech/utils/instantiators.py function instantiate_callbacks (line 13) | def instantiate_callbacks(callbacks_cfg: DictConfig) -> List[Callback]: function instantiate_loggers (line 33) | def instantiate_loggers(logger_cfg: DictConfig) -> List[Logger]: FILE: xinference/thirdparty/fish_speech/fish_speech/utils/logger.py class RankedLogger (line 7) | class RankedLogger(logging.LoggerAdapter): method __init__ (line 10) | def __init__( method log (line 27) | def log( FILE: xinference/thirdparty/fish_speech/fish_speech/utils/logging_utils.py function log_hyperparameters (line 7) | def log_hyperparameters(object_dict: dict) -> None: FILE: xinference/thirdparty/fish_speech/fish_speech/utils/rich_utils.py function print_config_tree (line 16) | def print_config_tree( function enforce_tags (line 82) | def enforce_tags(cfg: DictConfig, save_to_file: bool = False) -> None: FILE: xinference/thirdparty/fish_speech/fish_speech/utils/spectrogram.py class LinearSpectrogram (line 7) | class LinearSpectrogram(nn.Module): method __init__ (line 8) | def __init__( method forward (line 26) | def forward(self, y: Tensor) -> Tensor: class LogMelSpectrogram (line 60) | class LogMelSpectrogram(nn.Module): method __init__ (line 61) | def __init__( method compress (line 100) | def compress(self, x: Tensor) -> Tensor: method decompress (line 103) | def decompress(self, x: Tensor) -> Tensor: method apply_mel_scale (line 106) | def apply_mel_scale(self, x: Tensor) -> Tensor: method forward (line 109) | def forward( FILE: xinference/thirdparty/fish_speech/fish_speech/utils/utils.py function extras (line 16) | def extras(cfg: DictConfig) -> None: function task_wrapper (line 46) | def task_wrapper(task_func: Callable) -> Callable: function get_metric_value (line 100) | def get_metric_value(metric_dict: dict, metric_name: str) -> float: function set_seed (line 120) | def set_seed(seed: int): FILE: xinference/thirdparty/fish_speech/fish_speech/webui/js/animate.js function createGradioAnimation (line 2) | function createGradioAnimation() { FILE: xinference/thirdparty/fish_speech/fish_speech/webui/launch_utils.py function is_module_installed (line 21) | def is_module_installed(module_name: str) -> bool: function commit_hash (line 27) | def commit_hash(): function versions_html (line 36) | def versions_html(): function version_check (line 56) | def version_check(commit): class Seafoam (line 76) | class Seafoam(Base): method __init__ (line 77) | def __init__( FILE: xinference/thirdparty/fish_speech/fish_speech/webui/manage.py function build_html_error_message (line 41) | def build_html_error_message(error): function build_html_ok_message (line 49) | def build_html_ok_message(msg): function build_html_href (line 57) | def build_html_href(link, desc, msg): function load_data_in_raw (line 66) | def load_data_in_raw(path): function kill_proc_tree (line 72) | def kill_proc_tree(pid, including_parent=True): function kill_process (line 98) | def kill_process(pid): function change_label (line 107) | def change_label(if_label): function clean_infer_cache (line 137) | def clean_infer_cache(): function change_infer (line 153) | def change_infer( function load_yaml_data_in_fact (line 209) | def load_yaml_data_in_fact(yml_path): function write_yaml_data_in_fact (line 215) | def write_yaml_data_in_fact(yml, yml_path): function generate_tree (line 221) | def generate_tree(directory, depth=0, max_depth=None, prefix=""): function new_explorer (line 249) | def new_explorer(data_path, max_depth): function add_item (line 256) | def add_item( function remove_items (line 290) | def remove_items(selected_items): function show_selected (line 304) | def show_selected(options): function convert_to_mono_in_place (line 316) | def convert_to_mono_in_place(audio_path: Path): function list_copy (line 324) | def list_copy(list_file_path, method): function check_files (line 364) | def check_files(data_path: str, max_depth: int, label_model: str, label_... function generate_folder_name (line 424) | def generate_folder_name(): function train_process (line 430) | def train_process( function tensorboard_process (line 544) | def tensorboard_process( function fresh_tb_dir (line 579) | def fresh_tb_dir(): function list_decoder_models (line 585) | def list_decoder_models(): function list_llama_models (line 592) | def list_llama_models(): function list_lora_llama_models (line 602) | def list_lora_llama_models(): function fresh_decoder_model (line 611) | def fresh_decoder_model(): function fresh_llama_ckpt (line 615) | def fresh_llama_ckpt(llama_use_lora): function fresh_llama_model (line 626) | def fresh_llama_model(): function llama_lora_merge (line 630) | def llama_lora_merge(llama_weight, lora_llama_config, lora_weight, llama... function llama_quantify (line 657) | def llama_quantify(llama_weight, quantify_mode): FILE: xinference/thirdparty/fish_speech/tools/api_client.py function parse_args (line 15) | def parse_args(): FILE: xinference/thirdparty/fish_speech/tools/api_server.py class API (line 23) | class API(ExceptionHandler): method __init__ (line 24) | def __init__(self): method initialize_app (line 62) | async def initialize_app(self, app: Kui): FILE: xinference/thirdparty/fish_speech/tools/download_models.py function check_and_download_files (line 7) | def check_and_download_files(repo_id, file_list, local_dir): FILE: xinference/thirdparty/fish_speech/tools/e2e_webui.py function wav_chunk_header (line 12) | def wav_chunk_header(sample_rate=44100, bit_depth=16, channels=1): class ChatState (line 25) | class ChatState: method __init__ (line 26) | def __init__(self): method get_history (line 31) | def get_history(self): method repr_message (line 47) | def repr_message(self, msg: ServeMessage): function clear_fn (line 57) | def clear_fn(): function process_audio_input (line 61) | async def process_audio_input( function process_text_input (line 122) | async def process_text_input( function create_demo (line 131) | def create_demo(): FILE: xinference/thirdparty/fish_speech/tools/extract_model.py function main (line 9) | def main(model_path, output_path): FILE: xinference/thirdparty/fish_speech/tools/file.py function audio_to_bytes (line 27) | def audio_to_bytes(file_path): function read_ref_text (line 35) | def read_ref_text(ref_text): function list_files (line 43) | def list_files( function load_filelist (line 75) | def load_filelist(path: Path | str) -> list[tuple[Path, str, str, str]]: FILE: xinference/thirdparty/fish_speech/tools/fish_e2e.py class CustomAudioFrame (line 26) | class CustomAudioFrame: method __init__ (line 27) | def __init__(self, data, sample_rate, num_channels, samples_per_channel): method data (line 41) | def data(self): method sample_rate (line 45) | def sample_rate(self): method num_channels (line 49) | def num_channels(self): method samples_per_channel (line 53) | def samples_per_channel(self): method duration (line 57) | def duration(self): method __repr__ (line 60) | def __repr__(self): class FishE2EEventType (line 69) | class FishE2EEventType(Enum): class FishE2EEvent (line 79) | class FishE2EEvent: class FishE2EAgent (line 96) | class FishE2EAgent: method __init__ (line 97) | def __init__(self): method get_codes (line 102) | async def get_codes(self, audio_data, sample_rate): method stream (line 120) | async def stream( function main (line 264) | async def main(): FILE: xinference/thirdparty/fish_speech/tools/inference_engine/__init__.py class TTSInferenceEngine (line 23) | class TTSInferenceEngine(ReferenceLoader, VQManager): method __init__ (line 25) | def __init__( method inference (line 41) | def inference(self, req: ServeTTSRequest) -> Generator[InferenceResult... method send_Llama_request (line 139) | def send_Llama_request( method get_audio_segment (line 179) | def get_audio_segment(self, result: GenerateResponse) -> np.ndarray: FILE: xinference/thirdparty/fish_speech/tools/inference_engine/reference_loader.py class ReferenceLoader (line 15) | class ReferenceLoader: method __init__ (line 17) | def __init__(self) -> None: method load_by_id (line 36) | def load_by_id( method load_by_hash (line 72) | def load_by_hash( method load_audio (line 105) | def load_audio(self, reference_audio, sr): FILE: xinference/thirdparty/fish_speech/tools/inference_engine/utils.py class InferenceResult (line 12) | class InferenceResult: function normalize_text (line 18) | def normalize_text(user_input: str, use_normalization: bool) -> str: function wav_chunk_header (line 26) | def wav_chunk_header( FILE: xinference/thirdparty/fish_speech/tools/inference_engine/vq_manager.py class VQManager (line 9) | class VQManager: method __init__ (line 11) | def __init__(self): method decode_vq_tokens (line 16) | def decode_vq_tokens(self, codes): method encode_reference (line 30) | def encode_reference(self, reference_audio, enable_reference_audio): FILE: xinference/thirdparty/fish_speech/tools/llama/build_dataset.py function task_generator_folder (line 23) | def task_generator_folder(root: Path, text_extension: str): function task_generator_filelist (line 55) | def task_generator_filelist(filelist): function run_task (line 65) | def run_task(task): function main (line 127) | def main(input, output, num_workers, text_extension, shard_size): FILE: xinference/thirdparty/fish_speech/tools/llama/eval_in_context.py function smooth (line 16) | def smooth( function analyze_one_model (line 30) | def analyze_one_model(loader, config, weight, max_length): function main (line 115) | def main(): FILE: xinference/thirdparty/fish_speech/tools/llama/generate.py function multinomial_sample_one_no_sync (line 49) | def multinomial_sample_one_no_sync( function logits_to_probs (line 56) | def logits_to_probs( function multinomial_sample_one_no_sync_agent (line 88) | def multinomial_sample_one_no_sync_agent( function logits_to_probs_agent (line 95) | def logits_to_probs_agent( function sample (line 127) | def sample( function sample_agent (line 139) | def sample_agent( function decode_one_token_ar_agent (line 151) | def decode_one_token_ar_agent( function decode_one_token_naive_agent (line 210) | def decode_one_token_naive_agent( function decode_one_token_ar (line 250) | def decode_one_token_ar( function decode_one_token_naive (line 316) | def decode_one_token_naive( function decode_n_tokens (line 352) | def decode_n_tokens( function generate (line 405) | def generate( function decode_n_tokens_agent (line 478) | def decode_n_tokens_agent( function generate_agent (line 544) | def generate_agent( function encode_tokens (line 614) | def encode_tokens( function load_model (line 676) | def load_model(checkpoint_path, device, precision, compile=False, is_age... class GenerateResponse (line 708) | class GenerateResponse: function generate_long (line 714) | def generate_long( class WrappedGenerateResponse (line 891) | class WrappedGenerateResponse: class GenerateRequest (line 897) | class GenerateRequest: function launch_thread_safe_queue (line 902) | def launch_thread_safe_queue( function launch_thread_safe_queue_agent (line 947) | def launch_thread_safe_queue_agent( function main (line 1030) | def main( FILE: xinference/thirdparty/fish_speech/tools/llama/merge_lora.py function merge (line 21) | def merge(lora_config, base_weight, lora_weight, output): FILE: xinference/thirdparty/fish_speech/tools/llama/quantize.py function dynamically_quantize_per_channel (line 22) | def dynamically_quantize_per_channel(x, quant_min, quant_max, target_dty... function get_group_qparams (line 57) | def get_group_qparams(w, n_bit=4, groupsize=128): function pack_scales_and_zeros (line 78) | def pack_scales_and_zeros(scales, zeros): function unpack_scales_and_zeros (line 95) | def unpack_scales_and_zeros(scales_and_zeros): function group_quantize_tensor_from_qparams (line 101) | def group_quantize_tensor_from_qparams(w, scales, zeros, n_bit=4, groups... function group_quantize_tensor (line 130) | def group_quantize_tensor(w, n_bit=4, groupsize=128): function group_dequantize_tensor_from_qparams (line 137) | def group_dequantize_tensor_from_qparams( function group_dequantize_tensor (line 157) | def group_dequantize_tensor(w_int32, scales_and_zeros, n_bit=4, groupsiz... class QuantHandler (line 164) | class QuantHandler: method __init__ (line 165) | def __init__(self, mod): method create_quantized_state_dict (line 168) | def create_quantized_state_dict(self) -> "StateDict": method convert_for_runtime (line 171) | def convert_for_runtime(self) -> "nn.Module": function replace_linear_weight_only_int8_per_channel (line 178) | def replace_linear_weight_only_int8_per_channel(module): class WeightOnlyInt8QuantHandler (line 190) | class WeightOnlyInt8QuantHandler: method __init__ (line 191) | def __init__(self, mod): method create_quantized_state_dict (line 195) | def create_quantized_state_dict(self): method convert_for_runtime (line 207) | def convert_for_runtime(self): class WeightOnlyInt8Linear (line 212) | class WeightOnlyInt8Linear(torch.nn.Module): method __init__ (line 218) | def __init__( method forward (line 235) | def forward(self, input: torch.Tensor) -> torch.Tensor: function prepare_int4_weight_and_scales_and_zeros (line 242) | def prepare_int4_weight_and_scales_and_zeros(weight_bf16, groupsize, inn... function linear_forward_int4 (line 252) | def linear_forward_int4(x, weight_int4pack, scales_and_zeros, out_featur... function _check_linear_int4_k (line 263) | def _check_linear_int4_k(k, groupsize=1, inner_k_tiles=1): function replace_linear_int4 (line 267) | def replace_linear_int4(module, groupsize, inner_k_tiles, padding): class WeightOnlyInt4QuantHandler (line 300) | class WeightOnlyInt4QuantHandler: method __init__ (line 301) | def __init__(self, mod, groupsize=128, inner_k_tiles=8, padding=True): method create_quantized_state_dict (line 310) | def create_quantized_state_dict(self): method convert_for_runtime (line 353) | def convert_for_runtime(self): class WeightOnlyInt4Linear (line 358) | class WeightOnlyInt4Linear(torch.nn.Module): method __init__ (line 364) | def __init__( method forward (line 410) | def forward(self, input: torch.Tensor) -> torch.Tensor: function generate_folder_name (line 421) | def generate_folder_name(): function quantize (line 440) | def quantize(checkpoint_path: Path, mode: str, groupsize: int, timestamp... FILE: xinference/thirdparty/fish_speech/tools/run_webui.py function parse_args (line 22) | def parse_args(): FILE: xinference/thirdparty/fish_speech/tools/schema.py class ServeVQPart (line 13) | class ServeVQPart(BaseModel): class ServeTextPart (line 18) | class ServeTextPart(BaseModel): class ServeAudioPart (line 23) | class ServeAudioPart(BaseModel): class ASRPackRequest (line 29) | class ASRPackRequest: class ServeASRRequest (line 35) | class ServeASRRequest(BaseModel): class ServeASRTranscription (line 42) | class ServeASRTranscription(BaseModel): class ServeASRSegment (line 48) | class ServeASRSegment(BaseModel): class ServeTimedASRResponse (line 54) | class ServeTimedASRResponse(BaseModel): class ServeASRResponse (line 60) | class ServeASRResponse(BaseModel): class ServeMessage (line 64) | class ServeMessage(BaseModel): method to_conversation_message (line 68) | def to_conversation_message(self): class ServeChatRequest (line 86) | class ServeChatRequest(BaseModel): class ServeVQGANEncodeRequest (line 97) | class ServeVQGANEncodeRequest(BaseModel): class ServeVQGANEncodeResponse (line 102) | class ServeVQGANEncodeResponse(BaseModel): class ServeVQGANDecodeRequest (line 106) | class ServeVQGANDecodeRequest(BaseModel): class ServeVQGANDecodeResponse (line 110) | class ServeVQGANDecodeResponse(BaseModel): class ServeForwardMessage (line 115) | class ServeForwardMessage(BaseModel): class ServeResponse (line 120) | class ServeResponse(BaseModel): class ServeStreamDelta (line 126) | class ServeStreamDelta(BaseModel): class ServeStreamResponse (line 131) | class ServeStreamResponse(BaseModel): class ServeReferenceAudio (line 138) | class ServeReferenceAudio(BaseModel): method __repr__ (line 142) | def __repr__(self) -> str: class ServeTTSRequest (line 146) | class ServeTTSRequest(BaseModel): class Config (line 168) | class Config: FILE: xinference/thirdparty/fish_speech/tools/sensevoice/auto_model.py function prepare_data_iterator (line 37) | def prepare_data_iterator(data_in, input_len=None, data_type=None, key=N... class AutoModel (line 114) | class AutoModel: method __init__ (line 116) | def __init__(self, **kwargs): method build_model (line 189) | def build_model(**kwargs): method __call__ (line 275) | def __call__(self, *args, **cfg): method generate (line 281) | def generate(self, input, input_len=None, **cfg): method inference (line 288) | def inference( method vad (line 360) | def vad(self, input, input_len=None, **cfg): method inference_with_vadres (line 382) | def inference_with_vadres(self, input, vad_res, input_len=None, **cfg): method export (line 543) | def export(self, input=None, **cfg): FILE: xinference/thirdparty/fish_speech/tools/sensevoice/fun_asr.py function uvr5_cli (line 24) | def uvr5_cli( function get_sample_rate (line 69) | def get_sample_rate(media_path: Path): function convert_to_mono (line 91) | def convert_to_mono(src_path: Path, out_path: Path, out_fmt: str = "wav"): function convert_video_to_audio (line 119) | def convert_video_to_audio(video_path: Path, audio_dir: Path): function main (line 150) | def main( FILE: xinference/thirdparty/fish_speech/tools/sensevoice/vad_utils.py function slice_padding_fbank (line 5) | def slice_padding_fbank(speech, speech_lengths, vad_segments): function slice_padding_audio_samples (line 21) | def slice_padding_audio_samples(speech, speech_lengths, vad_segments): function merge_vad (line 37) | def merge_vad(vad_result, max_length=15000, min_length=0): FILE: xinference/thirdparty/fish_speech/tools/server/agent/__init__.py function execute_request (line 10) | def execute_request(input_queue, tokenizer, config, request, device): function response_generator (line 22) | def response_generator(req, llama_queue, tokenizer, config, device): function streaming_generator (line 31) | async def streaming_generator(req, llama_queue, tokenizer, config, devic... function get_response_generator (line 46) | def get_response_generator( FILE: xinference/thirdparty/fish_speech/tools/server/agent/generate.py function generate_responses (line 15) | def generate_responses( function finalize_response (line 77) | def finalize_response( FILE: xinference/thirdparty/fish_speech/tools/server/agent/generation_utils.py function initialize_decode_buffers (line 11) | def initialize_decode_buffers(num_samples): function send_reset_buffer (line 19) | def send_reset_buffer(sample_id, decode_buffer, tokenizer, parts, request): function handle_semantic_tokens (line 37) | def handle_semantic_tokens(tokens, config, sample_id, parts, request): function process_response_tokens (line 66) | def process_response_tokens( FILE: xinference/thirdparty/fish_speech/tools/server/agent/pre_generation_utils.py function prepare_messages (line 8) | def prepare_messages(request, tokenizer, config): function create_generation_request (line 49) | def create_generation_request(prompt, request, im_end_id, device): function send_generation_request (line 66) | def send_generation_request(input_queue, req): FILE: xinference/thirdparty/fish_speech/tools/server/api_utils.py function parse_args (line 14) | def parse_args(): class MsgPackRequest (line 39) | class MsgPackRequest(HttpRequest): method data (line 40) | async def data( function inference_async (line 57) | async def inference_async(req: ServeTTSRequest, engine: TTSInferenceEngi... function buffer_to_async_generator (line 63) | async def buffer_to_async_generator(buffer): function get_content_type (line 67) | def get_content_type(audio_format): FILE: xinference/thirdparty/fish_speech/tools/server/exception_handler.py class ExceptionHandler (line 7) | class ExceptionHandler: method http_exception_handler (line 9) | async def http_exception_handler(self, exc: HTTPException): method other_exception_handler (line 20) | async def other_exception_handler(self, exc: Exception): FILE: xinference/thirdparty/fish_speech/tools/server/inference.py function inference_wrapper (line 12) | def inference_wrapper(req: ServeTTSRequest, engine: TTSInferenceEngine): FILE: xinference/thirdparty/fish_speech/tools/server/model_manager.py class ModelManager (line 17) | class ModelManager: method __init__ (line 18) | def __init__( method load_asr_model (line 67) | def load_asr_model(self, device, hub="ms") -> None: method load_llama_model (line 76) | def load_llama_model( method load_decoder_model (line 101) | def load_decoder_model(self, config_name, checkpoint_path, device) -> ... method warm_up (line 109) | def warm_up(self, tts_inference_engine) -> None: FILE: xinference/thirdparty/fish_speech/tools/server/model_utils.py function batch_encode (line 17) | def batch_encode(model, audios_list: list[bytes]): function cached_vqgan_batch_encode (line 51) | def cached_vqgan_batch_encode(model, audios: list[bytes]): function vqgan_decode (line 57) | def vqgan_decode(model, features): function batch_asr (line 86) | def batch_asr(model, lock, audios, sr, language="auto"): FILE: xinference/thirdparty/fish_speech/tools/server/views.py class HealthView (line 36) | class HealthView(HttpView): method post (line 42) | async def post(cls): class VQGANEncodeView (line 46) | class VQGANEncodeView(HttpView): method post (line 52) | async def post(cls): class VQGANDecodeView (line 75) | class VQGANDecodeView(HttpView): method post (line 81) | async def post(cls): class ASRView (line 106) | class ASRView(HttpView): method post (line 112) | async def post(cls): class TTSView (line 142) | class TTSView(HttpView): method post (line 148) | async def post(cls): class ChatView (line 201) | class ChatView(HttpView): method post (line 207) | async def post(cls): FILE: xinference/thirdparty/fish_speech/tools/smart_pad.py function process (line 16) | def process(file): function main (line 52) | def main(source, num_workers): FILE: xinference/thirdparty/fish_speech/tools/vqgan/create_train_split.py function main (line 20) | def main(root, val_ratio, val_count, filelist, min_duration, max_duration): FILE: xinference/thirdparty/fish_speech/tools/vqgan/extract_vq.py function get_model (line 49) | def get_model( function process_batch (line 81) | def process_batch(files: list[Path], model) -> float: function main (line 146) | def main( FILE: xinference/thirdparty/fish_speech/tools/vqgan/inference.py function load_model (line 20) | def load_model(config_name, checkpoint_path, device="cuda"): function main (line 68) | def main(input_path, output_path, config_name, checkpoint_path, device): FILE: xinference/thirdparty/fish_speech/tools/webui/__init__.py function build_app (line 10) | def build_app(inference_fct: Callable, theme: str = "light") -> gr.Blocks: FILE: xinference/thirdparty/fish_speech/tools/webui/inference.py function inference_wrapper (line 9) | def inference_wrapper( function get_reference_audio (line 60) | def get_reference_audio(reference_audio: str, reference_text: str) -> list: function build_html_error_message (line 71) | def build_html_error_message(error: Any) -> str: function get_inference_wrapper (line 83) | def get_inference_wrapper(engine) -> Callable: FILE: xinference/thirdparty/fish_speech/tools/whisper_asr.py function main (line 58) | def main( FILE: xinference/thirdparty/indextts/BigVGAN/ECAPA_TDNN.py function length_to_mask (line 16) | def length_to_mask(length, max_len=None, dtype=None, device=None): class Conv1d (line 65) | class Conv1d(_Conv1d): method __init__ (line 68) | def __init__(self, *args, **kwargs): class BatchNorm1d (line 72) | class BatchNorm1d(_BatchNorm1d): method __init__ (line 75) | def __init__(self, *args, **kwargs): class TDNNBlock (line 79) | class TDNNBlock(nn.Module): method __init__ (line 106) | def __init__( method forward (line 126) | def forward(self, x): class Res2NetBlock (line 131) | class Res2NetBlock(torch.nn.Module): method __init__ (line 156) | def __init__( method forward (line 179) | def forward(self, x): class SEBlock (line 194) | class SEBlock(nn.Module): method __init__ (line 216) | def __init__(self, in_channels, se_channels, out_channels): method forward (line 228) | def forward(self, x, lengths=None): class AttentiveStatisticsPooling (line 245) | class AttentiveStatisticsPooling(nn.Module): method __init__ (line 268) | def __init__(self, channels, attention_channels=128, global_context=Tr... method forward (line 282) | def forward(self, x, lengths=None): class SERes2NetBlock (line 341) | class SERes2NetBlock(nn.Module): method __init__ (line 373) | def __init__( method forward (line 415) | def forward(self, x, lengths=None): class ECAPA_TDNN (line 429) | class ECAPA_TDNN(torch.nn.Module): method __init__ (line 470) | def __init__( method forward (line 543) | def forward(self, x, lengths=None): class Classifier (line 584) | class Classifier(torch.nn.Module): method __init__ (line 612) | def __init__( method forward (line 638) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/activations.py class Snake (line 9) | class Snake(nn.Module): method __init__ (line 26) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 49) | def forward(self, x): class SnakeBeta (line 63) | class SnakeBeta(nn.Module): method __init__ (line 81) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 109) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_activation/cuda/activation1d.py class FusedAntiAliasActivation (line 13) | class FusedAntiAliasActivation(torch.autograd.Function): method forward (line 21) | def forward(ctx, inputs, up_ftr, down_ftr, alpha, beta): method backward (line 29) | def backward(ctx, output_grads): class Activation1d (line 34) | class Activation1d(nn.Module): method __init__ (line 35) | def __init__( method forward (line 53) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_activation/cuda/anti_alias_activation.cpp function PYBIND11_MODULE (line 21) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_activation/cuda/load.py function chinese_path_compile_support (line 23) | def chinese_path_compile_support(sources, buildpath): function load (line 48) | def load(): function _get_cuda_bare_metal_version (line 103) | def _get_cuda_bare_metal_version(cuda_dir): function _create_build_dir (line 116) | def _create_build_dir(buildpath): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_activation/torch/act.py class Activation1d (line 9) | class Activation1d(nn.Module): method __init__ (line 10) | def __init__( method forward (line 26) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_activation/torch/filter.py function sinc (line 16) | def sinc(x: torch.Tensor): function kaiser_sinc_filter1d (line 31) | def kaiser_sinc_filter1d( class LowPassFilter1d (line 66) | class LowPassFilter1d(nn.Module): method __init__ (line 67) | def __init__( method forward (line 95) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_activation/torch/resample.py class UpSample1d (line 10) | class UpSample1d(nn.Module): method __init__ (line 11) | def __init__(self, ratio=2, kernel_size=None): method forward (line 29) | def forward(self, x): class DownSample1d (line 41) | class DownSample1d(nn.Module): method __init__ (line 42) | def __init__(self, ratio=2, kernel_size=None): method forward (line 55) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_torch/act.py class Activation1d (line 9) | class Activation1d(nn.Module): method __init__ (line 10) | def __init__(self, method forward (line 24) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_torch/filter.py function sinc (line 16) | def sinc(x: torch.Tensor): function kaiser_sinc_filter1d (line 29) | def kaiser_sinc_filter1d(cutoff, half_width, kernel_size): # return filt... class LowPassFilter1d (line 61) | class LowPassFilter1d(nn.Module): method __init__ (line 62) | def __init__(self, method forward (line 87) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/alias_free_torch/resample.py class UpSample1d (line 10) | class UpSample1d(nn.Module): method __init__ (line 11) | def __init__(self, ratio=2, kernel_size=None): method forward (line 25) | def forward(self, x): class DownSample1d (line 36) | class DownSample1d(nn.Module): method __init__ (line 37) | def __init__(self, ratio=2, kernel_size=None): method forward (line 46) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/bigvgan.py function load_hparams_from_json (line 26) | def load_hparams_from_json(path) -> AttrDict: class AMPBlock1 (line 32) | class AMPBlock1(torch.nn.Module): method __init__ (line 45) | def __init__( method forward (line 132) | def forward(self, x): method remove_weight_norm (line 143) | def remove_weight_norm(self): class AMPBlock2 (line 150) | class AMPBlock2(torch.nn.Module): method __init__ (line 163) | def __init__( method forward (line 231) | def forward(self, x): method remove_weight_norm (line 238) | def remove_weight_norm(self): class BigVGAN (line 254) | class BigVGAN( method __init__ (line 270) | def __init__(self, h: AttrDict, use_cuda_kernel: bool = False): method forward (line 374) | def forward(self, x, mel_refer, lens=None): method remove_weight_norm (line 430) | def remove_weight_norm(self): method _save_pretrained (line 445) | def _save_pretrained(self, save_directory: Path) -> None: method _from_pretrained (line 456) | def _from_pretrained( FILE: xinference/thirdparty/indextts/BigVGAN/models.py class AMPBlock1 (line 20) | class AMPBlock1(torch.nn.Module): method __init__ (line 21) | def __init__(self, h, channels, kernel_size=3, dilation=(1, 3, 5), act... method forward (line 65) | def forward(self, x): method remove_weight_norm (line 76) | def remove_weight_norm(self): class AMPBlock2 (line 83) | class AMPBlock2(torch.nn.Module): method __init__ (line 84) | def __init__(self, h, channels, kernel_size=3, dilation=(1, 3), activa... method forward (line 117) | def forward(self, x): method remove_weight_norm (line 125) | def remove_weight_norm(self): class BigVGAN (line 130) | class BigVGAN(torch.nn.Module): method __init__ (line 132) | def __init__(self, h, use_cuda_kernel=False): method forward (line 201) | def forward(self, x, mel_ref, lens=None): method remove_weight_norm (line 252) | def remove_weight_norm(self): method cal_clip_loss (line 262) | def cal_clip_loss(self, image_features, text_features, logit_scale): method get_logits (line 272) | def get_logits(self, image_features, text_features, logit_scale): class DiscriminatorP (line 278) | class DiscriminatorP(torch.nn.Module): method __init__ (line 279) | def __init__(self, h, period, kernel_size=5, stride=3, use_spectral_no... method forward (line 293) | def forward(self, x): class MultiPeriodDiscriminator (line 315) | class MultiPeriodDiscriminator(torch.nn.Module): method __init__ (line 316) | def __init__(self, h): method forward (line 323) | def forward(self, y, y_hat): class DiscriminatorR (line 339) | class DiscriminatorR(nn.Module): method __init__ (line 340) | def __init__(self, cfg, resolution): method forward (line 366) | def forward(self, x): method spectrogram (line 381) | def spectrogram(self, x): class MultiResolutionDiscriminator (line 392) | class MultiResolutionDiscriminator(nn.Module): method __init__ (line 393) | def __init__(self, cfg, debug=False): method forward (line 403) | def forward(self, y, y_hat): function feature_loss (line 420) | def feature_loss(fmap_r, fmap_g): function discriminator_loss (line 429) | def discriminator_loss(disc_real_outputs, disc_generated_outputs): function generator_loss (line 443) | def generator_loss(disc_outputs): FILE: xinference/thirdparty/indextts/BigVGAN/nnet/CNN.py class SincConv (line 23) | class SincConv(nn.Module): method __init__ (line 68) | def __init__( method forward (line 109) | def forward(self, x): method _check_input_shape (line 165) | def _check_input_shape(self, shape): method _get_sinc_filters (line 185) | def _get_sinc_filters(self): method _init_sinc_conv (line 229) | def _init_sinc_conv(self): method _to_mel (line 265) | def _to_mel(self, hz): method _to_hz (line 269) | def _to_hz(self, mel): method _manage_padding (line 273) | def _manage_padding(self, x, kernel_size: int, dilation: int, stride: ... class Conv1d (line 305) | class Conv1d(nn.Module): method __init__ (line 356) | def __init__( method forward (line 411) | def forward(self, x): method _manage_padding (line 458) | def _manage_padding(self, x, kernel_size: int, dilation: int, stride: ... method _check_input_shape (line 490) | def _check_input_shape(self, shape): method remove_weight_norm (line 514) | def remove_weight_norm(self): function get_padding_elem (line 519) | def get_padding_elem(L_in: int, stride: int, kernel_size: int, dilation:... FILE: xinference/thirdparty/indextts/BigVGAN/nnet/linear.py class Linear (line 14) | class Linear(torch.nn.Module): method __init__ (line 42) | def __init__( method forward (line 66) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/nnet/normalization.py class BatchNorm1d (line 13) | class BatchNorm1d(nn.Module): method __init__ (line 47) | def __init__( method forward (line 75) | def forward(self, x): class BatchNorm2d (line 111) | class BatchNorm2d(nn.Module): method __init__ (line 140) | def __init__( method forward (line 165) | def forward(self, x): class LayerNorm (line 185) | class LayerNorm(nn.Module): method __init__ (line 210) | def __init__( method forward (line 230) | def forward(self, x): class InstanceNorm1d (line 245) | class InstanceNorm1d(nn.Module): method __init__ (line 276) | def __init__( method forward (line 301) | def forward(self, x): class InstanceNorm2d (line 321) | class InstanceNorm2d(nn.Module): method __init__ (line 352) | def __init__( method forward (line 377) | def forward(self, x): class GroupNorm (line 397) | class GroupNorm(nn.Module): method __init__ (line 424) | def __init__( method forward (line 452) | def forward(self, x): class ExponentialMovingAverage (line 472) | class ExponentialMovingAverage(nn.Module): method __init__ (line 500) | def __init__( method forward (line 526) | def forward(self, x): class PCEN (line 557) | class PCEN(nn.Module): method __init__ (line 602) | def __init__( method forward (line 637) | def forward(self, x): FILE: xinference/thirdparty/indextts/BigVGAN/utils.py function plot_spectrogram (line 18) | def plot_spectrogram(spectrogram): function plot_spectrogram_clipped (line 29) | def plot_spectrogram_clipped(spectrogram, clip_max=2.0): function init_weights (line 47) | def init_weights(m, mean=0.0, std=0.01): function apply_weight_norm (line 53) | def apply_weight_norm(m): function get_padding (line 59) | def get_padding(kernel_size, dilation=1): function load_checkpoint (line 63) | def load_checkpoint(filepath, device): function save_checkpoint (line 71) | def save_checkpoint(filepath, obj): function scan_checkpoint (line 77) | def scan_checkpoint(cp_dir, prefix, renamed_file=None): function save_audio (line 97) | def save_audio(audio, path, sr): FILE: xinference/thirdparty/indextts/cli.py function main (line 7) | def main(): FILE: xinference/thirdparty/indextts/gpt/conformer/attention.py class MultiHeadedAttention (line 26) | class MultiHeadedAttention(nn.Module): method __init__ (line 35) | def __init__(self, n_head: int, n_feat: int, dropout_rate: float): method forward_qkv (line 48) | def forward_qkv( method forward_attention (line 77) | def forward_attention( method forward (line 122) | def forward(self, query: torch.Tensor, key: torch.Tensor, class RelPositionMultiHeadedAttention (line 189) | class RelPositionMultiHeadedAttention(MultiHeadedAttention): method __init__ (line 197) | def __init__(self, n_head, n_feat, dropout_rate): method rel_shift (line 209) | def rel_shift(self, x, zero_triu: bool = False): method forward (line 235) | def forward(self, query: torch.Tensor, FILE: xinference/thirdparty/indextts/gpt/conformer/embedding.py class PositionalEncoding (line 25) | class PositionalEncoding(torch.nn.Module): method __init__ (line 35) | def __init__(self, method forward (line 57) | def forward(self, method position_encoding (line 77) | def position_encoding(self, offset: Union[int, torch.Tensor], size: int, class RelPositionalEncoding (line 115) | class RelPositionalEncoding(PositionalEncoding): method __init__ (line 123) | def __init__(self, d_model: int, dropout_rate: float, max_len: int = 5... method forward (line 127) | def forward(self, class NoPositionalEncoding (line 144) | class NoPositionalEncoding(torch.nn.Module): method __init__ (line 147) | def __init__(self, d_model: int, dropout_rate: float): method forward (line 152) | def forward(self, method position_encoding (line 161) | def position_encoding( FILE: xinference/thirdparty/indextts/gpt/conformer/subsampling.py class BaseSubsampling (line 24) | class BaseSubsampling(torch.nn.Module): method __init__ (line 25) | def __init__(self): method position_encoding (line 30) | def position_encoding(self, offset: Union[int, torch.Tensor], class LinearNoSubsampling (line 35) | class LinearNoSubsampling(BaseSubsampling): method __init__ (line 44) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 57) | def forward( class Conv2dSubsampling3 (line 81) | class Conv2dSubsampling3(BaseSubsampling): method __init__ (line 90) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 107) | def forward( class Conv2dSubsampling2 (line 135) | class Conv2dSubsampling2(BaseSubsampling): method __init__ (line 144) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 161) | def forward( class Conv2dSubsampling4 (line 189) | class Conv2dSubsampling4(BaseSubsampling): method __init__ (line 198) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 217) | def forward( class Conv2dSubsampling6 (line 245) | class Conv2dSubsampling6(BaseSubsampling): method __init__ (line 253) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 270) | def forward( class Conv2dSubsampling8 (line 296) | class Conv2dSubsampling8(BaseSubsampling): method __init__ (line 305) | def __init__(self, idim: int, odim: int, dropout_rate: float, method forward (line 324) | def forward( FILE: xinference/thirdparty/indextts/gpt/conformer_encoder.py class PositionwiseFeedForward (line 20) | class PositionwiseFeedForward(torch.nn.Module): method __init__ (line 33) | def __init__(self, method forward (line 45) | def forward(self, xs: torch.Tensor) -> torch.Tensor: class ConvolutionModule (line 56) | class ConvolutionModule(nn.Module): method __init__ (line 59) | def __init__(self, method forward (line 112) | def forward( class ConformerEncoderLayer (line 170) | class ConformerEncoderLayer(nn.Module): method __init__ (line 194) | def __init__( method forward (line 232) | def forward( class BaseEncoder (line 316) | class BaseEncoder(torch.nn.Module): method __init__ (line 317) | def __init__( method output_size (line 397) | def output_size(self) -> int: method forward (line 400) | def forward( class ConformerEncoder (line 439) | class ConformerEncoder(BaseEncoder): method __init__ (line 442) | def __init__( FILE: xinference/thirdparty/indextts/gpt/model.py function null_position_embeddings (line 22) | def null_position_embeddings(range, dim): class ResBlock (line 26) | class ResBlock(nn.Module): method __init__ (line 31) | def __init__(self, chan): method forward (line 41) | def forward(self, x): class GPT2InferenceModel (line 45) | class GPT2InferenceModel(GPT2PreTrainedModel): method __init__ (line 46) | def __init__(self, config, gpt, text_pos_emb, embeddings, norm, linear... method parallelize (line 61) | def parallelize(self, device_map=None): method deparallelize (line 72) | def deparallelize(self): method get_output_embeddings (line 81) | def get_output_embeddings(self): method set_output_embeddings (line 84) | def set_output_embeddings(self, new_embeddings): method store_mel_emb (line 87) | def store_mel_emb(self, mel_emb): method prepare_inputs_for_generation (line 90) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... method forward (line 120) | def forward( method _reorder_cache (line 200) | def _reorder_cache(past, beam_idx): class ConditioningEncoder (line 215) | class ConditioningEncoder(nn.Module): method __init__ (line 216) | def __init__(self, method forward (line 233) | def forward(self, x): class LearnedPositionEmbeddings (line 243) | class LearnedPositionEmbeddings(nn.Module): method __init__ (line 244) | def __init__(self, seq_len, model_dim, init=.02): method forward (line 250) | def forward(self, x): method get_fixed_embedding (line 254) | def get_fixed_embedding(self, ind, dev): function build_hf_gpt_transformer (line 258) | def build_hf_gpt_transformer(layers, model_dim, heads, max_mel_seq_len, ... class MelEncoder (line 282) | class MelEncoder(nn.Module): method __init__ (line 283) | def __init__(self, channels, mel_channels=80, resblocks_per_reduction=2): method forward (line 299) | def forward(self, x): class UnifiedVoice (line 305) | class UnifiedVoice(nn.Module): method __init__ (line 306) | def __init__(self, layers=8, model_dim=512, heads=8, max_text_tokens=1... method post_init_gpt2_config (line 393) | def post_init_gpt2_config(self, use_deepspeed=False, kv_cache=False, h... method build_aligned_inputs_and_targets (line 434) | def build_aligned_inputs_and_targets(self, input, start_token, stop_to... method set_mel_padding (line 439) | def set_mel_padding(self, mel_input_tokens, mel_lengths): method set_text_padding (line 453) | def set_text_padding(self, text_input_tokens, text_lengths): method get_logits (line 467) | def get_logits(self, speech_conditioning_inputs, first_inputs, first_h... method get_conditioning (line 495) | def get_conditioning(self, speech_conditioning_input, cond_mel_lengths... method forward (line 526) | def forward(self, speech_conditioning_latent, text_inputs, text_length... method prepare_gpt_inputs (line 596) | def prepare_gpt_inputs( method inference_speech (line 660) | def inference_speech(self, speech_conditioning_mel, text_inputs, cond_... FILE: xinference/thirdparty/indextts/gpt/model_v2.py function null_position_embeddings (line 22) | def null_position_embeddings(range, dim): class ResBlock (line 26) | class ResBlock(nn.Module): method __init__ (line 31) | def __init__(self, chan): method forward (line 41) | def forward(self, x): class GPT2InferenceModel (line 45) | class GPT2InferenceModel(GPT2PreTrainedModel): method __init__ (line 46) | def __init__(self, config, gpt, text_pos_emb, embeddings, norm, linear... method parallelize (line 61) | def parallelize(self, device_map=None): method deparallelize (line 72) | def deparallelize(self): method get_output_embeddings (line 81) | def get_output_embeddings(self): method set_output_embeddings (line 84) | def set_output_embeddings(self, new_embeddings): method store_mel_emb (line 87) | def store_mel_emb(self, mel_emb): method prepare_inputs_for_generation (line 90) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... method forward (line 120) | def forward( method _reorder_cache (line 200) | def _reorder_cache(past, beam_idx): class ConditioningEncoder (line 215) | class ConditioningEncoder(nn.Module): method __init__ (line 216) | def __init__(self, method forward (line 233) | def forward(self, x): class LearnedPositionEmbeddings (line 243) | class LearnedPositionEmbeddings(nn.Module): method __init__ (line 244) | def __init__(self, seq_len, model_dim, init=.02): method forward (line 250) | def forward(self, x): method get_fixed_embedding (line 254) | def get_fixed_embedding(self, ind, dev): function build_hf_gpt_transformer (line 258) | def build_hf_gpt_transformer(layers, model_dim, heads, max_mel_seq_len, ... class MelEncoder (line 281) | class MelEncoder(nn.Module): method __init__ (line 282) | def __init__(self, channels, mel_channels=80, resblocks_per_reduction=2): method forward (line 298) | def forward(self, x): class UnifiedVoice (line 304) | class UnifiedVoice(nn.Module): method __init__ (line 305) | def __init__(self, layers=8, model_dim=512, heads=8, max_text_tokens=1... method post_init_gpt2_config (line 412) | def post_init_gpt2_config(self, use_deepspeed=False, kv_cache=False, h... method build_aligned_inputs_and_targets (line 453) | def build_aligned_inputs_and_targets(self, input, start_token, stop_to... method set_mel_padding (line 458) | def set_mel_padding(self, mel_input_tokens, mel_lengths): method set_text_padding (line 472) | def set_text_padding(self, text_input_tokens, text_lengths): method get_logits (line 486) | def get_logits(self, speech_conditioning_inputs, first_inputs, first_h... method get_conditioning (line 514) | def get_conditioning(self, speech_conditioning_input, cond_mel_lengths... method get_emo_conditioning (line 546) | def get_emo_conditioning(self, speech_conditioning_input, cond_mel_len... method forward (line 554) | def forward(self, speech_conditioning_latent, text_inputs, text_length... method prepare_gpt_inputs (line 598) | def prepare_gpt_inputs( method inference_speech (line 663) | def inference_speech(self, speech_condition, text_inputs, emo_speech_c... method get_emovec (line 736) | def get_emovec(self, emo_speech_conditioning_latent, emo_cond_lengths): method merge_emovec (line 742) | def merge_emovec(self, speech_conditioning_latent, emo_speech_conditio... FILE: xinference/thirdparty/indextts/gpt/perceiver.py function exists (line 14) | def exists(val): function once (line 18) | def once(fn): class Attend (line 36) | class Attend(nn.Module): method __init__ (line 37) | def __init__(self, dropout=0.0, causal=False, use_flash=False): method get_mask (line 67) | def get_mask(self, n, device): method flash_attn (line 75) | def flash_attn(self, q, k, v, mask=None): method forward (line 107) | def forward(self, q, k, v, mask=None): function Sequential (line 153) | def Sequential(*mods): function exists (line 157) | def exists(x): function default (line 161) | def default(val, d): class RMSNorm (line 167) | class RMSNorm(nn.Module): method __init__ (line 168) | def __init__(self, dim, scale=True, dim_cond=None): method forward (line 176) | def forward(self, x, cond=None): class CausalConv1d (line 189) | class CausalConv1d(nn.Conv1d): method __init__ (line 190) | def __init__(self, *args, **kwargs): method forward (line 199) | def forward(self, x): class GEGLU (line 204) | class GEGLU(nn.Module): method forward (line 205) | def forward(self, x): function FeedForward (line 210) | def FeedForward(dim, mult=4, causal_conv=False): class PerceiverResampler (line 224) | class PerceiverResampler(nn.Module): method __init__ (line 225) | def __init__( method forward (line 263) | def forward(self, x, mask=None): class Attention (line 277) | class Attention(nn.Module): method __init__ (line 278) | def __init__( method forward (line 303) | def forward(self, x, context=None, mask=None): FILE: xinference/thirdparty/indextts/gpt/transformers_beam_search.py class BeamScorer (line 91) | class BeamScorer(ABC): method process (line 99) | def process( method finalize (line 111) | def finalize( class BeamSearchScorer (line 123) | class BeamSearchScorer(BeamScorer): method __init__ (line 162) | def __init__( method is_done (line 212) | def is_done(self) -> bool: method process (line 215) | def process( method finalize (line 320) | def finalize( class ConstrainedBeamSearchScorer (line 419) | class ConstrainedBeamSearchScorer(BeamScorer): method __init__ (line 456) | def __init__( method is_done (line 502) | def is_done(self) -> bool: method make_constraint_states (line 505) | def make_constraint_states(self, n): method check_completes_constraints (line 508) | def check_completes_constraints(self, sequence): method process (line 513) | def process( method step_sentence_constraint (line 672) | def step_sentence_constraint( method finalize (line 813) | def finalize( class BeamHypotheses (line 930) | class BeamHypotheses: method __init__ (line 931) | def __init__(self, num_beams: int, length_penalty: float, early_stoppi... method __len__ (line 948) | def __len__(self): method add (line 954) | def add( method is_done (line 979) | def is_done(self, best_sum_logprobs: float, cur_len: int, decoder_prom... FILE: xinference/thirdparty/indextts/gpt/transformers_generation_utils.py class QuantizedCacheConfig (line 135) | class QuantizedCacheConfig: method __init__ (line 136) | def __init__(self, backend: str = "quanto", nbits: int = 4, function _crop_past_key_values (line 147) | def _crop_past_key_values(model, past_key_values, max_length): class GenerateDecoderOnlyOutput (line 184) | class GenerateDecoderOnlyOutput(ModelOutput): class GenerateEncoderDecoderOutput (line 220) | class GenerateEncoderDecoderOutput(ModelOutput): class GenerateBeamDecoderOnlyOutput (line 268) | class GenerateBeamDecoderOnlyOutput(ModelOutput): class GenerateBeamEncoderDecoderOutput (line 312) | class GenerateBeamEncoderDecoderOutput(ModelOutput): class GenerationMixin (line 396) | class GenerationMixin: method prepare_inputs_for_generation (line 413) | def prepare_inputs_for_generation( method _prepare_model_inputs (line 538) | def _prepare_model_inputs( method _maybe_initialize_input_ids_for_generation (line 602) | def _maybe_initialize_input_ids_for_generation( method _prepare_attention_mask_for_generation (line 634) | def _prepare_attention_mask_for_generation( method _prepare_encoder_decoder_kwargs_for_generation (line 663) | def _prepare_encoder_decoder_kwargs_for_generation( method _prepare_decoder_input_ids_for_generation (line 704) | def _prepare_decoder_input_ids_for_generation( method _expand_inputs_for_generation (line 764) | def _expand_inputs_for_generation( method _extract_past_from_model_output (line 798) | def _extract_past_from_model_output(self, outputs: ModelOutput): method _update_model_kwargs_for_generation (line 813) | def _update_model_kwargs_for_generation( method _reorder_cache (line 857) | def _reorder_cache(self, past_key_values, beam_idx): method _get_candidate_generator (line 863) | def _get_candidate_generator( method _get_logits_processor (line 908) | def _get_logits_processor( method _get_stopping_criteria (line 1138) | def _get_stopping_criteria( method _merge_criteria_processor_list (line 1177) | def _merge_criteria_processor_list( method compute_transition_scores (line 1198) | def compute_transition_scores( method _validate_model_class (line 1320) | def _validate_model_class(self): method _validate_assistant (line 1341) | def _validate_assistant(self, assistant_model, tokenizer, assistant_to... method _validate_model_kwargs (line 1371) | def _validate_model_kwargs(self, model_kwargs: Dict[str, Any]): method _validate_generated_length (line 1431) | def _validate_generated_length(self, generation_config, input_ids_leng... method _prepare_generated_length (line 1480) | def _prepare_generated_length( method _prepare_generation_config (line 1530) | def _prepare_generation_config( method _get_initial_cache_position (line 1592) | def _get_initial_cache_position(self, input_ids, model_kwargs): method _get_cache (line 1621) | def _get_cache( method _supports_default_dynamic_cache (line 1712) | def _supports_default_dynamic_cache(self) -> bool: method _prepare_cache_for_generation (line 1726) | def _prepare_cache_for_generation( method _supports_num_logits_to_keep (line 1843) | def _supports_num_logits_to_keep(self) -> bool: method _prepare_special_tokens (line 1850) | def _prepare_special_tokens( method generate (line 1935) | def generate( method _has_unfinished_sequences (line 2453) | def _has_unfinished_sequences( method heal_tokens (line 2484) | def heal_tokens( method _dola_decoding (line 2569) | def _dola_decoding( method _contrastive_search (line 2782) | def _contrastive_search( method _sample (line 3189) | def _sample( method _temporary_reorder_cache (line 3365) | def _temporary_reorder_cache(self, past_key_values, beam_idx): method _beam_search (line 3391) | def _beam_search( method _group_beam_search (line 3677) | def _group_beam_search( method _constrained_beam_search (line 3968) | def _constrained_beam_search( method _assisted_decoding (line 4207) | def _assisted_decoding( function _speculative_sampling (line 4474) | def _speculative_sampling( function _split_model_outputs (line 4530) | def _split_model_outputs(outputs, new_outputs, cur_len, added_len, is_de... function _ranking_fast (line 4556) | def _ranking_fast( function _split (line 4587) | def _split(data, full_batch_size: int, num_hidden_layers: int, split_siz... function _split_model_inputs (line 4623) | def _split_model_inputs( function stack_model_outputs (line 4689) | def stack_model_outputs(model_outputs: List[ModelOutput], config: Pretra... function _relative_top_filter (line 4744) | def _relative_top_filter( function _dola_select_contrast (line 4769) | def _dola_select_contrast( FILE: xinference/thirdparty/indextts/gpt/transformers_gpt2.py class SequenceSummary (line 37) | class SequenceSummary(nn.Module): method __init__ (line 41) | def __init__(self, config): method forward (line 66) | def forward(self, hidden_states, cls_token_index=None): function load_tf_weights_in_gpt2 (line 123) | def load_tf_weights_in_gpt2(model, config, gpt2_checkpoint_path): class GPT2Attention (line 179) | class GPT2Attention(nn.Module): method __init__ (line 180) | def __init__(self, config, is_cross_attention=False, layer_idx=None): method prune_heads (line 224) | def prune_heads(self, heads): method _attn (line 239) | def _attn(self, query, key, value, attention_mask=None, head_mask=None): method _upcast_and_reordered_attn (line 279) | def _upcast_and_reordered_attn(self, query, key, value, attention_mask... method _split_heads (line 331) | def _split_heads(self, tensor, num_heads, attn_head_size): method _merge_heads (line 339) | def _merge_heads(self, tensor, num_heads, attn_head_size): method forward (line 347) | def forward( class GPT2FlashAttention2 (line 401) | class GPT2FlashAttention2(GPT2Attention): method __init__ (line 409) | def __init__(self, *args, **kwargs): method forward (line 417) | def forward( class GPT2SdpaAttention (line 514) | class GPT2SdpaAttention(GPT2Attention): method __init__ (line 521) | def __init__(self, *args, **kwargs): method forward (line 530) | def forward( class GPT2MLP (line 621) | class GPT2MLP(nn.Module): method __init__ (line 622) | def __init__(self, intermediate_size, config): method forward (line 630) | def forward(self, hidden_states: Optional[Tuple[torch.FloatTensor]]) -... class GPT2Block (line 641) | class GPT2Block(nn.Module): method __init__ (line 642) | def __init__(self, config, layer_idx=None): method forward (line 658) | def forward( class GPT2PreTrainedModel (line 720) | class GPT2PreTrainedModel(PreTrainedModel): method __init__ (line 736) | def __init__(self, *inputs, **kwargs): method _init_weights (line 739) | def _init_weights(self, module): class GPT2DoubleHeadsModelOutput (line 768) | class GPT2DoubleHeadsModelOutput(ModelOutput): class GPT2Model (line 948) | class GPT2Model(GPT2PreTrainedModel): method __init__ (line 951) | def __init__(self, config): method parallelize (line 973) | def parallelize(self, device_map=None): method deparallelize (line 1000) | def deparallelize(self): method get_input_embeddings (line 1016) | def get_input_embeddings(self): method set_input_embeddings (line 1019) | def set_input_embeddings(self, new_embeddings): method _prune_heads (line 1022) | def _prune_heads(self, heads_to_prune): method forward (line 1035) | def forward( class GPT2LMHeadModel (line 1244) | class GPT2LMHeadModel(GPT2PreTrainedModel, GenerationMixin): method __init__ (line 1247) | def __init__(self, config): method parallelize (line 1260) | def parallelize(self, device_map=None): method deparallelize (line 1279) | def deparallelize(self): method get_output_embeddings (line 1290) | def get_output_embeddings(self): method set_output_embeddings (line 1293) | def set_output_embeddings(self, new_embeddings): method forward (line 1302) | def forward( method _reorder_cache (line 1376) | def _reorder_cache( class GPT2DoubleHeadsModel (line 1399) | class GPT2DoubleHeadsModel(GPT2PreTrainedModel, GenerationMixin): method __init__ (line 1402) | def __init__(self, config): method parallelize (line 1417) | def parallelize(self, device_map=None): method deparallelize (line 1437) | def deparallelize(self): method get_output_embeddings (line 1449) | def get_output_embeddings(self): method set_output_embeddings (line 1452) | def set_output_embeddings(self, new_embeddings): method forward (line 1457) | def forward( method _reorder_cache (line 1569) | def _reorder_cache( class GPT2ForSequenceClassification (line 1598) | class GPT2ForSequenceClassification(GPT2PreTrainedModel): method __init__ (line 1599) | def __init__(self, config): method forward (line 1618) | def forward( class GPT2ForTokenClassification (line 1724) | class GPT2ForTokenClassification(GPT2PreTrainedModel): method __init__ (line 1725) | def __init__(self, config): method forward (line 1769) | def forward( class GPT2ForQuestionAnswering (line 1835) | class GPT2ForQuestionAnswering(GPT2PreTrainedModel): method __init__ (line 1836) | def __init__(self, config): method forward (line 1856) | def forward( FILE: xinference/thirdparty/indextts/gpt/transformers_modeling_utils.py function is_fsdp_enabled (line 145) | def is_fsdp_enabled(): function is_local_dist_rank_0 (line 154) | def is_local_dist_rank_0(): function no_init_weights (line 192) | def no_init_weights(_enable=True): function get_parameter_device (line 220) | def get_parameter_device(parameter: Union[nn.Module, "ModuleUtilsMixin"]): function get_first_parameter_dtype (line 235) | def get_first_parameter_dtype(parameter: Union[nn.Module, "ModuleUtilsMi... function get_parameter_dtype (line 253) | def get_parameter_dtype(parameter: Union[nn.Module, "ModuleUtilsMixin"]): function get_state_dict_float_dtype (line 302) | def get_state_dict_float_dtype(state_dict): function get_state_dict_dtype (line 313) | def get_state_dict_dtype(state_dict): function dtype_byte_size (line 326) | def dtype_byte_size(dtype): function check_support_param_buffer_assignment (line 346) | def check_support_param_buffer_assignment(model_to_load, state_dict, sta... function shard_checkpoint (line 377) | def shard_checkpoint( function load_sharded_checkpoint (line 463) | def load_sharded_checkpoint(model, folder, strict=True, prefer_safe=True): function load_state_dict (line 548) | def load_state_dict( function set_initialized_submodules (line 618) | def set_initialized_submodules(model, state_dict_keys): function _end_ptr (line 636) | def _end_ptr(tensor: torch.Tensor) -> int: function _get_tied_weight_keys (line 645) | def _get_tied_weight_keys(module: nn.Module, prefix=""): function _find_disjoint (line 659) | def _find_disjoint(tensors: List[Set[str]], state_dict: Dict[str, torch.... function _find_identical (line 690) | def _find_identical(tensors: List[Set[str]], state_dict: Dict[str, torch... function _load_state_dict_into_model (line 709) | def _load_state_dict_into_model(model_to_load, state_dict, start_prefix,... function find_submodule_and_param_name (line 787) | def find_submodule_and_param_name(model, long_key, start_prefix): function _move_model_to_meta (line 810) | def _move_model_to_meta(model, loaded_state_dict_keys, start_prefix): function _load_state_dict_into_meta_model (line 836) | def _load_state_dict_into_meta_model( function _add_variant (line 1016) | def _add_variant(weights_name: str, variant: Optional[str] = None) -> str: class ModuleUtilsMixin (line 1025) | class ModuleUtilsMixin: method _hook_rss_memory_pre_forward (line 1031) | def _hook_rss_memory_pre_forward(module, *args, **kwargs): method _hook_rss_memory_post_forward (line 1043) | def _hook_rss_memory_post_forward(module, *args, **kwargs): method add_memory_hooks (line 1056) | def add_memory_hooks(self): method reset_memory_hooks_state (line 1068) | def reset_memory_hooks_state(self): method device (line 1078) | def device(self) -> torch.device: method dtype (line 1086) | def dtype(self) -> torch.dtype: method invert_attention_mask (line 1092) | def invert_attention_mask(self, encoder_attention_mask: Tensor) -> Ten... method create_extended_attention_mask_for_decoder (line 1117) | def create_extended_attention_mask_for_decoder(input_shape, attention_... method get_extended_attention_mask (line 1144) | def get_extended_attention_mask( method get_head_mask (line 1196) | def get_head_mask( method _convert_head_mask_to_5d (line 1223) | def _convert_head_mask_to_5d(self, head_mask, num_hidden_layers): method num_parameters (line 1234) | def num_parameters(self, only_trainable: bool = False, exclude_embeddi... method estimate_tokens (line 1288) | def estimate_tokens(self, input_dict: Dict[str, Union[torch.Tensor, An... method floating_point_ops (line 1309) | def floating_point_ops( class PreTrainedModel (line 1337) | class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, Push... method dummy_inputs (line 1406) | def dummy_inputs(self) -> Dict[str, torch.Tensor]: method framework (line 1413) | def framework(self) -> str: method __init__ (line 1419) | def __init__(self, config: PretrainedConfig, *inputs, **kwargs): method post_init (line 1442) | def post_init(self): method dequantize (line 1450) | def dequantize(self): method _backward_compatibility_gradient_checkpointing (line 1462) | def _backward_compatibility_gradient_checkpointing(self): method add_model_tags (line 1468) | def add_model_tags(self, tags: Union[List[str], str]) -> None: method _from_config (line 1501) | def _from_config(cls, config, **kwargs): method _autoset_attn_implementation (line 1557) | def _autoset_attn_implementation( method _set_default_torch_dtype (line 1653) | def _set_default_torch_dtype(cls, dtype: torch.dtype) -> torch.dtype: method base_model (line 1680) | def base_model(self) -> nn.Module: method can_generate (line 1687) | def can_generate(cls) -> bool: method _check_and_enable_flash_attn_2 (line 1726) | def _check_and_enable_flash_attn_2( method _check_and_enable_sdpa (line 1820) | def _check_and_enable_sdpa(cls, config, hard_check_only: bool = False)... method enable_input_require_grads (line 1849) | def enable_input_require_grads(self): method disable_input_require_grads (line 1860) | def disable_input_require_grads(self): method get_input_embeddings (line 1866) | def get_input_embeddings(self) -> nn.Module: method set_input_embeddings (line 1879) | def set_input_embeddings(self, value: nn.Module): method get_output_embeddings (line 1892) | def get_output_embeddings(self) -> nn.Module: method _init_weights (line 1901) | def _init_weights(self, module): method _initialize_weights (line 1910) | def _initialize_weights(self, module): method tie_weights (line 1919) | def tie_weights(self): method _tie_encoder_decoder_weights (line 1947) | def _tie_encoder_decoder_weights( method _tie_or_clone_weights (line 2036) | def _tie_or_clone_weights(self, output_embeddings, input_embeddings): method _get_no_split_modules (line 2056) | def _get_no_split_modules(self, device_map: str): method resize_token_embeddings (line 2085) | def resize_token_embeddings( method _resize_token_embeddings (line 2144) | def _resize_token_embeddings(self, new_num_tokens, pad_to_multiple_of=... method _get_resized_embeddings (line 2183) | def _get_resized_embeddings( method _get_resized_lm_head (line 2341) | def _get_resized_lm_head( method _init_added_embeddings_weights_with_mean (line 2469) | def _init_added_embeddings_weights_with_mean( method _init_added_lm_head_weights_with_mean (line 2496) | def _init_added_lm_head_weights_with_mean( method _init_added_lm_head_bias_with_mean (line 2520) | def _init_added_lm_head_bias_with_mean(self, old_lm_head, new_lm_head,... method _copy_lm_head_original_to_resized (line 2525) | def _copy_lm_head_original_to_resized( method resize_position_embeddings (line 2538) | def resize_position_embeddings(self, new_num_position_embeddings: int): method get_position_embeddings (line 2544) | def get_position_embeddings(self) -> Union[nn.Embedding, Tuple[nn.Embe... method init_weights (line 2550) | def init_weights(self): method prune_heads (line 2567) | def prune_heads(self, heads_to_prune: Dict[int, List[int]]): method gradient_checkpointing_enable (line 2584) | def gradient_checkpointing_enable(self, gradient_checkpointing_kwargs=... method _set_gradient_checkpointing (line 2626) | def _set_gradient_checkpointing(self, enable: bool = True, gradient_ch... method gradient_checkpointing_disable (line 2648) | def gradient_checkpointing_disable(self): method is_gradient_checkpointing (line 2672) | def is_gradient_checkpointing(self) -> bool: method save_pretrained (line 2681) | def save_pretrained( method push_to_hub (line 3071) | def push_to_hub(self, *args, **kwargs): method get_memory_footprint (line 3086) | def get_memory_footprint(self, return_buffers=True): method cuda (line 3105) | def cuda(self, *args, **kwargs): method to (line 3124) | def to(self, *args, **kwargs): method half (line 3163) | def half(self, *args): method float (line 3173) | def float(self, *args): method from_pretrained (line 3184) | def from_pretrained( method _load_pretrained_model (line 4334) | def _load_pretrained_model( method retrieve_modules_from_names (line 4834) | def retrieve_modules_from_names(self, names, add_prefix=False, remove_... method _load_pretrained_model_low_mem (line 4858) | def _load_pretrained_model_low_mem( method register_for_auto_class (line 4898) | def register_for_auto_class(cls, auto_class="AutoModel"): method to_bettertransformer (line 4923) | def to_bettertransformer(self) -> "PreTrainedModel": method reverse_bettertransformer (line 4951) | def reverse_bettertransformer(self): method warn_if_padding_and_no_attention_mask (line 4973) | def warn_if_padding_and_no_attention_mask(self, input_ids, attention_m... method _is_quantized_training_enabled (line 5009) | def _is_quantized_training_enabled(self): method loss_function (line 5021) | def loss_function(self): class PoolerStartLogits (line 5049) | class PoolerStartLogits(nn.Module): method __init__ (line 5058) | def __init__(self, config: PretrainedConfig): method forward (line 5062) | def forward( class PoolerEndLogits (line 5087) | class PoolerEndLogits(nn.Module): method __init__ (line 5097) | def __init__(self, config: PretrainedConfig): method forward (line 5104) | def forward( class PoolerAnswerClass (line 5156) | class PoolerAnswerClass(nn.Module): method __init__ (line 5165) | def __init__(self, config): method forward (line 5171) | def forward( class SquadHeadOutput (line 5222) | class SquadHeadOutput(ModelOutput): class SQuADHead (line 5252) | class SQuADHead(nn.Module): method __init__ (line 5262) | def __init__(self, config): method forward (line 5272) | def forward( class SequenceSummary (line 5369) | class SequenceSummary(nn.Module): method __init__ (line 5395) | def __init__(self, config: PretrainedConfig): method forward (line 5424) | def forward( function unwrap_model (line 5468) | def unwrap_model(model: nn.Module, recursive: bool = False) -> nn.Module: function expand_device_map (line 5498) | def expand_device_map(device_map, param_names, start_prefix): function get_disk_only_shard_files (line 5511) | def get_disk_only_shard_files(device_map, sharded_metadata, start_prefix): FILE: xinference/thirdparty/indextts/infer.py class IndexTTS (line 27) | class IndexTTS: method __init__ (line 28) | def __init__( method remove_long_silence (line 134) | def remove_long_silence(self, codes: torch.Tensor, silent_token=52, ma... method bucket_segments (line 191) | def bucket_segments(self, segments, bucket_max_size=4) -> List[List[Di... method pad_tokens_cat (line 249) | def pad_tokens_cat(self, tokens: List[torch.Tensor]) -> torch.Tensor: method torch_empty_cache (line 269) | def torch_empty_cache(self): method _set_gr_progress (line 278) | def _set_gr_progress(self, value, desc): method infer_fast (line 283) | def infer_fast(self, audio_prompt, text, output_path, verbose=False, m... method infer (line 519) | def infer(self, audio_prompt, text, output_path, verbose=False, max_te... FILE: xinference/thirdparty/indextts/infer_v2.py class IndexTTS2 (line 39) | class IndexTTS2: method __init__ (line 40) | def __init__( method get_emb (line 382) | def get_emb(self, input_features, attention_mask): method remove_long_silence (line 392) | def remove_long_silence( method insert_interval_silence (line 454) | def insert_interval_silence(self, wavs, sampling_rate=22050, interval_... method _set_gr_progress (line 477) | def _set_gr_progress(self, value, desc): method _load_and_cut_audio (line 481) | def _load_and_cut_audio( method infer (line 500) | def infer( method infer_stream (line 887) | def infer_stream( function find_most_similar_cosine (line 1001) | def find_most_similar_cosine(query_vector, matrix): class QwenEmotion (line 1010) | class QwenEmotion: method __init__ (line 1011) | def __init__(self, model_dir): method clamp_score (line 1055) | def clamp_score(self, value): method convert (line 1058) | def convert(self, content): method inference (line 1076) | def inference(self, text_input): FILE: xinference/thirdparty/indextts/s2mel/dac/__main__.py function run (line 12) | def run(stage: str): FILE: xinference/thirdparty/indextts/s2mel/dac/model/base.py class DACFile (line 16) | class DACFile: method save (line 28) | def save(self, path): method load (line 47) | def load(cls, path): class CodecMixin (line 57) | class CodecMixin: method padding (line 59) | def padding(self): method padding (line 65) | def padding(self, value): method get_delay (line 82) | def get_delay(self): method get_output_length (line 108) | def get_output_length(self, input_length): method compress (line 126) | def compress( method decompress (line 236) | def decompress( FILE: xinference/thirdparty/indextts/s2mel/dac/model/dac.py function init_weights (line 19) | def init_weights(m): class ResidualUnit (line 25) | class ResidualUnit(nn.Module): method __init__ (line 26) | def __init__(self, dim: int = 16, dilation: int = 1, causal: bool = Fa... method forward (line 37) | def forward(self, x): class EncoderBlock (line 45) | class EncoderBlock(nn.Module): method __init__ (line 46) | def __init__(self, dim: int = 16, stride: int = 1, causal: bool = False): method forward (line 65) | def forward(self, x): class Encoder (line 69) | class Encoder(nn.Module): method __init__ (line 70) | def __init__( method forward (line 103) | def forward(self, x): method reset_cache (line 106) | def reset_cache(self): class DecoderBlock (line 118) | class DecoderBlock(nn.Module): method __init__ (line 119) | def __init__(self, input_dim: int = 16, output_dim: int = 8, stride: i... method forward (line 138) | def forward(self, x): class Decoder (line 142) | class Decoder(nn.Module): method __init__ (line 143) | def __init__( method forward (line 175) | def forward(self, x): class DAC (line 179) | class DAC(BaseModel, CodecMixin): method __init__ (line 180) | def __init__( method preprocess (line 234) | def preprocess(self, audio_data, sample_rate): method encode (line 245) | def encode( method decode (line 285) | def decode(self, z: torch.Tensor): method forward (line 304) | def forward( FILE: xinference/thirdparty/indextts/s2mel/dac/model/discriminator.py function WNConv1d (line 11) | def WNConv1d(*args, **kwargs): function WNConv2d (line 19) | def WNConv2d(*args, **kwargs): class MPD (line 27) | class MPD(nn.Module): method __init__ (line 28) | def __init__(self, period): method pad_to_period (line 44) | def pad_to_period(self, x): method forward (line 49) | def forward(self, x): class MSD (line 65) | class MSD(nn.Module): method __init__ (line 66) | def __init__(self, rate: int = 1, sample_rate: int = 44100): method forward (line 82) | def forward(self, x): class MRD (line 101) | class MRD(nn.Module): method __init__ (line 102) | def __init__( method spectrogram (line 149) | def spectrogram(self, x): method forward (line 157) | def forward(self, x): class Discriminator (line 175) | class Discriminator(nn.Module): method __init__ (line 176) | def __init__( method preprocess (line 207) | def preprocess(self, y): method forward (line 214) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/dac/model/encodec.py class ConvLayerNorm (line 23) | class ConvLayerNorm(nn.LayerNorm): method __init__ (line 28) | def __init__(self, normalized_shape: tp.Union[int, tp.List[int], torch... method forward (line 31) | def forward(self, x): function apply_parametrization_norm (line 42) | def apply_parametrization_norm(module: nn.Module, norm: str = 'none') ->... function get_norm_module (line 54) | def get_norm_module(module: nn.Module, causal: bool = False, norm: str =... function get_extra_padding_for_conv1d (line 71) | def get_extra_padding_for_conv1d(x: torch.Tensor, kernel_size: int, stri... function pad_for_conv1d (line 81) | def pad_for_conv1d(x: torch.Tensor, kernel_size: int, stride: int, paddi... function pad1d (line 96) | def pad1d(x: torch.Tensor, paddings: tp.Tuple[int, int], mode: str = 'ze... function unpad1d (line 116) | def unpad1d(x: torch.Tensor, paddings: tp.Tuple[int, int]): class NormConv1d (line 125) | class NormConv1d(nn.Module): method __init__ (line 129) | def __init__(self, *args, causal: bool = False, norm: str = 'none', method forward (line 136) | def forward(self, x): class NormConv2d (line 142) | class NormConv2d(nn.Module): method __init__ (line 146) | def __init__(self, *args, norm: str = 'none', method forward (line 153) | def forward(self, x): class NormConvTranspose1d (line 159) | class NormConvTranspose1d(nn.Module): method __init__ (line 163) | def __init__(self, *args, causal: bool = False, norm: str = 'none', method forward (line 170) | def forward(self, x): class NormConvTranspose2d (line 176) | class NormConvTranspose2d(nn.Module): method __init__ (line 180) | def __init__(self, *args, norm: str = 'none', method forward (line 186) | def forward(self, x): class SConv1d (line 192) | class SConv1d(nn.Module): method __init__ (line 196) | def __init__(self, in_channels: int, out_channels: int, method reset_cache (line 214) | def reset_cache(self): method forward (line 219) | def forward(self, x): class SConvTranspose1d (line 254) | class SConvTranspose1d(nn.Module): method __init__ (line 258) | def __init__(self, in_channels: int, out_channels: int, method forward (line 271) | def forward(self, x): class SLSTM (line 295) | class SLSTM(nn.Module): method __init__ (line 300) | def __init__(self, dimension: int, num_layers: int = 2, skip: bool = T... method forward (line 307) | def forward(self, x): method reset_cache (line 318) | def reset_cache(self): FILE: xinference/thirdparty/indextts/s2mel/dac/nn/layers.py function WNConv1d (line 9) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 13) | def WNConvTranspose1d(*args, **kwargs): function snake (line 19) | def snake(x, alpha): class Snake1d (line 27) | class Snake1d(nn.Module): method __init__ (line 28) | def __init__(self, channels): method forward (line 32) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/dac/nn/loss.py class L1Loss (line 11) | class L1Loss(nn.L1Loss): method __init__ (line 26) | def __init__(self, attribute: str = "audio_data", weight: float = 1.0,... method forward (line 31) | def forward(self, x: AudioSignal, y: AudioSignal): class SISDRLoss (line 51) | class SISDRLoss(nn.Module): method __init__ (line 76) | def __init__( method forward (line 91) | def forward(self, x: AudioSignal, y: AudioSignal): class MultiScaleSTFTLoss (line 142) | class MultiScaleSTFTLoss(nn.Module): method __init__ (line 174) | def __init__( method forward (line 203) | def forward(self, x: AudioSignal, y: AudioSignal): class MelSpectrogramLoss (line 231) | class MelSpectrogramLoss(nn.Module): method __init__ (line 259) | def __init__( method forward (line 294) | def forward(self, x: AudioSignal, y: AudioSignal): class GANLoss (line 330) | class GANLoss(nn.Module): method __init__ (line 338) | def __init__(self, discriminator): method forward (line 342) | def forward(self, fake, real): method discriminator_loss (line 347) | def discriminator_loss(self, fake, real): method generator_loss (line 356) | def generator_loss(self, fake, real): FILE: xinference/thirdparty/indextts/s2mel/dac/nn/quantize.py class VectorQuantizeLegacy (line 12) | class VectorQuantizeLegacy(nn.Module): method __init__ (line 19) | def __init__(self, input_dim: int, codebook_size: int): method forward (line 24) | def forward(self, z, z_mask=None): method embed_code (line 62) | def embed_code(self, embed_id): method decode_code (line 65) | def decode_code(self, embed_id): method decode_latents (line 68) | def decode_latents(self, latents): class VectorQuantize (line 86) | class VectorQuantize(nn.Module): method __init__ (line 98) | def __init__(self, input_dim: int, codebook_size: int, codebook_dim: i... method forward (line 107) | def forward(self, z, z_mask=None): method embed_code (line 149) | def embed_code(self, embed_id): method decode_code (line 152) | def decode_code(self, embed_id): method decode_latents (line 155) | def decode_latents(self, latents): class ResidualVectorQuantize (line 174) | class ResidualVectorQuantize(nn.Module): method __init__ (line 180) | def __init__( method forward (line 204) | def forward(self, z, n_quantizers: int = None): method from_codes (line 277) | def from_codes(self, codes: torch.Tensor): method from_latents (line 299) | def from_latents(self, latents: torch.Tensor): FILE: xinference/thirdparty/indextts/s2mel/dac/utils/__init__.py function download (line 43) | def download( function load_model (line 112) | def load_model( FILE: xinference/thirdparty/indextts/s2mel/dac/utils/decode.py function decode (line 19) | def decode( FILE: xinference/thirdparty/indextts/s2mel/dac/utils/encode.py function encode (line 20) | def encode( FILE: xinference/thirdparty/indextts/s2mel/hf_utils.py function load_custom_model_from_hf (line 5) | def load_custom_model_from_hf(repo_id, model_filename="pytorch_model.bin... FILE: xinference/thirdparty/indextts/s2mel/modules/alias_free_torch/act.py class Activation1d (line 7) | class Activation1d(nn.Module): method __init__ (line 8) | def __init__( method forward (line 24) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/alias_free_torch/filter.py function sinc (line 13) | def sinc(x: torch.Tensor): function kaiser_sinc_filter1d (line 27) | def kaiser_sinc_filter1d( class LowPassFilter1d (line 61) | class LowPassFilter1d(nn.Module): method __init__ (line 62) | def __init__( method forward (line 89) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/alias_free_torch/resample.py class UpSample1d (line 9) | class UpSample1d(nn.Module): method __init__ (line 10) | def __init__(self, ratio=2, kernel_size=None): method forward (line 28) | def forward(self, x): class DownSample1d (line 40) | class DownSample1d(nn.Module): method __init__ (line 41) | def __init__(self, ratio=2, kernel_size=None): method forward (line 54) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/audio.py function load_wav (line 10) | def load_wav(full_path): function dynamic_range_compression (line 15) | def dynamic_range_compression(x, C=1, clip_val=1e-5): function dynamic_range_decompression (line 19) | def dynamic_range_decompression(x, C=1): function dynamic_range_compression_torch (line 23) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 27) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 31) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 36) | def spectral_de_normalize_torch(magnitudes): function mel_spectrogram (line 45) | def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_siz... FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/activations.py class Snake (line 9) | class Snake(nn.Module): method __init__ (line 25) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 48) | def forward(self, x): class SnakeBeta (line 62) | class SnakeBeta(nn.Module): method __init__ (line 79) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 107) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/alias_free_activation/cuda/activation1d.py class FusedAntiAliasActivation (line 14) | class FusedAntiAliasActivation(torch.autograd.Function): method forward (line 22) | def forward(ctx, inputs, up_ftr, down_ftr, alpha, beta): method backward (line 30) | def backward(ctx, output_grads): class Activation1d (line 35) | class Activation1d(nn.Module): method __init__ (line 36) | def __init__( method forward (line 54) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/alias_free_activation/cuda/anti_alias_activation.cpp function PYBIND11_MODULE (line 21) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/alias_free_activation/cuda/load.py function load (line 17) | def load(): function _get_cuda_bare_metal_version (line 68) | def _get_cuda_bare_metal_version(cuda_dir): function _create_build_dir (line 81) | def _create_build_dir(buildpath): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/alias_free_activation/torch/act.py class Activation1d (line 8) | class Activation1d(nn.Module): method __init__ (line 9) | def __init__( method forward (line 25) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/alias_free_activation/torch/filter.py function sinc (line 15) | def sinc(x: torch.Tensor): function kaiser_sinc_filter1d (line 30) | def kaiser_sinc_filter1d( class LowPassFilter1d (line 65) | class LowPassFilter1d(nn.Module): method __init__ (line 66) | def __init__( method forward (line 94) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/alias_free_activation/torch/resample.py class UpSample1d (line 10) | class UpSample1d(nn.Module): method __init__ (line 11) | def __init__(self, ratio=2, kernel_size=None): method forward (line 29) | def forward(self, x): class DownSample1d (line 41) | class DownSample1d(nn.Module): method __init__ (line 42) | def __init__(self, ratio=2, kernel_size=None): method forward (line 55) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/bigvgan.py function load_hparams_from_json (line 25) | def load_hparams_from_json(path) -> AttrDict: class AMPBlock1 (line 31) | class AMPBlock1(torch.nn.Module): method __init__ (line 44) | def __init__( method forward (line 132) | def forward(self, x): method remove_weight_norm (line 143) | def remove_weight_norm(self): class AMPBlock2 (line 150) | class AMPBlock2(torch.nn.Module): method __init__ (line 163) | def __init__( method forward (line 232) | def forward(self, x): method remove_weight_norm (line 238) | def remove_weight_norm(self): class BigVGAN (line 243) | class BigVGAN( method __init__ (line 266) | def __init__(self, h: AttrDict, use_cuda_kernel: bool = False): method forward (line 360) | def forward(self, x): method remove_weight_norm (line 388) | def remove_weight_norm(self): method _save_pretrained (line 403) | def _save_pretrained(self, save_directory: Path) -> None: method _from_pretrained (line 414) | def _from_pretrained( FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/env.py class AttrDict (line 8) | class AttrDict(dict): method __init__ (line 9) | def __init__(self, *args, **kwargs): function build_env (line 14) | def build_env(config, config_name, path): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/meldataset.py function load_wav (line 22) | def load_wav(full_path, sr_target): function dynamic_range_compression (line 31) | def dynamic_range_compression(x, C=1, clip_val=1e-5): function dynamic_range_decompression (line 35) | def dynamic_range_decompression(x, C=1): function dynamic_range_compression_torch (line 39) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 43) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 47) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 51) | def spectral_de_normalize_torch(magnitudes): function mel_spectrogram (line 59) | def mel_spectrogram( function get_mel_spectrogram (line 131) | def get_mel_spectrogram(wav, h): function get_dataset_filelist (line 154) | def get_dataset_filelist(a): class MelDataset (line 190) | class MelDataset(torch.utils.data.Dataset): method __init__ (line 191) | def __init__( method __getitem__ (line 246) | def __getitem__(self, index): method __len__ (line 353) | def __len__(self): FILE: xinference/thirdparty/indextts/s2mel/modules/bigvgan/utils.py function plot_spectrogram (line 16) | def plot_spectrogram(spectrogram): function plot_spectrogram_clipped (line 27) | def plot_spectrogram_clipped(spectrogram, clip_max=2.0): function init_weights (line 45) | def init_weights(m, mean=0.0, std=0.01): function apply_weight_norm (line 51) | def apply_weight_norm(m): function get_padding (line 57) | def get_padding(kernel_size, dilation=1): function load_checkpoint (line 61) | def load_checkpoint(filepath, device): function save_checkpoint (line 69) | def save_checkpoint(filepath, obj): function scan_checkpoint (line 75) | def scan_checkpoint(cp_dir, prefix, renamed_file=None): function save_audio (line 95) | def save_audio(audio, path, sr): FILE: xinference/thirdparty/indextts/s2mel/modules/campplus/DTDNN.py class FCM (line 13) | class FCM(nn.Module): method __init__ (line 14) | def __init__(self, method _make_layer (line 31) | def _make_layer(self, block, planes, num_blocks, stride): method forward (line 39) | def forward(self, x): class CAMPPlus (line 50) | class CAMPPlus(nn.Module): method __init__ (line 51) | def __init__(self, method forward (line 111) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/campplus/classifier.py class CosineClassifier (line 11) | class CosineClassifier(nn.Module): method __init__ (line 12) | def __init__( method forward (line 34) | def forward(self, x): class LinearClassifier (line 43) | class LinearClassifier(nn.Module): method __init__ (line 44) | def __init__( method forward (line 64) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/campplus/layers.py function get_nonlinear (line 10) | def get_nonlinear(config_str, channels): function statistics_pooling (line 26) | def statistics_pooling(x, dim=-1, keepdim=False, unbiased=True, eps=1e-2): class StatsPool (line 35) | class StatsPool(nn.Module): method forward (line 36) | def forward(self, x): class TDNNLayer (line 40) | class TDNNLayer(nn.Module): method __init__ (line 41) | def __init__(self, method forward (line 64) | def forward(self, x): class CAMLayer (line 70) | class CAMLayer(nn.Module): method __init__ (line 71) | def __init__(self, method forward (line 93) | def forward(self, x): method seg_pooling (line 100) | def seg_pooling(self, x, seg_len=100, stype='avg'): class CAMDenseTDNNLayer (line 113) | class CAMDenseTDNNLayer(nn.Module): method __init__ (line 114) | def __init__(self, method bn_function (line 140) | def bn_function(self, x): method forward (line 143) | def forward(self, x): class CAMDenseTDNNBlock (line 152) | class CAMDenseTDNNBlock(nn.ModuleList): method __init__ (line 153) | def __init__(self, method forward (line 177) | def forward(self, x): class TransitLayer (line 183) | class TransitLayer(nn.Module): method __init__ (line 184) | def __init__(self, method forward (line 193) | def forward(self, x): class DenseLayer (line 199) | class DenseLayer(nn.Module): method __init__ (line 200) | def __init__(self, method forward (line 209) | def forward(self, x): class BasicResBlock (line 218) | class BasicResBlock(nn.Module): method __init__ (line 221) | def __init__(self, in_planes, planes, stride=1): method forward (line 248) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/commons.py function str2bool (line 11) | def str2bool(v): class AttrDict (line 21) | class AttrDict(dict): method __init__ (line 22) | def __init__(self, *args, **kwargs): function init_weights (line 27) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 33) | def get_padding(kernel_size, dilation=1): function convert_pad_shape (line 37) | def convert_pad_shape(pad_shape): function intersperse (line 43) | def intersperse(lst, item): function kl_divergence (line 49) | def kl_divergence(m_p, logs_p, m_q, logs_q): function rand_gumbel (line 58) | def rand_gumbel(shape): function rand_gumbel_like (line 64) | def rand_gumbel_like(x): function slice_segments (line 69) | def slice_segments(x, ids_str, segment_size=4): function slice_segments_audio (line 78) | def slice_segments_audio(x, ids_str, segment_size=4): function rand_slice_segments (line 87) | def rand_slice_segments(x, x_lengths=None, segment_size=4): function get_timing_signal_1d (line 99) | def get_timing_signal_1d(length, channels, min_timescale=1.0, max_timesc... function add_timing_signal_1d (line 115) | def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4): function cat_timing_signal_1d (line 121) | def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis... function subsequent_mask (line 127) | def subsequent_mask(length): function fused_add_tanh_sigmoid_multiply (line 133) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): function convert_pad_shape (line 142) | def convert_pad_shape(pad_shape): function shift_1d (line 148) | def shift_1d(x): function sequence_mask (line 153) | def sequence_mask(length, max_length=None): function avg_with_mask (line 160) | def avg_with_mask(x, mask): function generate_path (line 172) | def generate_path(duration, mask): function clip_grad_value_ (line 190) | def clip_grad_value_(parameters, clip_value, norm_type=2): function log_norm (line 208) | def log_norm(x, mean=-4, std=4, dim=2): function load_F0_models (line 216) | def load_F0_models(path): function modify_w2v_forward (line 228) | def modify_w2v_forward(self, output_layer=15): function plot_spectrogram_to_numpy (line 338) | def plot_spectrogram_to_numpy(spectrogram): function normalize_f0 (line 365) | def normalize_f0(f0_sequence): class MyModel (line 388) | class MyModel(nn.Module): method __init__ (line 389) | def __init__(self,args, use_emovec=False, use_gpt_latent=False): method forward (line 420) | def forward(self, x, target_lengths, prompt_len, cond, y): method forward2 (line 424) | def forward2(self, S_ori,target_lengths,F0_ori): method forward_emovec (line 428) | def forward_emovec(self, x): method forward_emo_encoder (line 432) | def forward_emo_encoder(self, x): method forward_gpt (line 436) | def forward_gpt(self,x): function build_model (line 442) | def build_model(args, stage="DiT"): function load_checkpoint (line 511) | def load_checkpoint( function load_checkpoint2 (line 568) | def load_checkpoint2( function recursive_munch (line 626) | def recursive_munch(d): FILE: xinference/thirdparty/indextts/s2mel/modules/diffusion_transformer.py function modulate (line 11) | def modulate(x, shift, scale): class TimestepEmbedder (line 19) | class TimestepEmbedder(nn.Module): method __init__ (line 23) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 40) | def timestep_embedding(self, t): method forward (line 57) | def forward(self, t): class StyleEmbedder (line 63) | class StyleEmbedder(nn.Module): method __init__ (line 67) | def __init__(self, input_size, hidden_size, dropout_prob): method forward (line 75) | def forward(self, labels, train, force_drop_ids=None): class FinalLayer (line 84) | class FinalLayer(nn.Module): method __init__ (line 88) | def __init__(self, hidden_size, patch_size, out_channels): method forward (line 97) | def forward(self, x, c): class DiT (line 103) | class DiT(torch.nn.Module): method __init__ (line 104) | def __init__( method setup_caches (line 183) | def setup_caches(self, max_batch_size, max_seq_length): method forward (line 186) | def forward(self, x, prompt_x, x_lens, t, style, cond, mask_content=Fa... FILE: xinference/thirdparty/indextts/s2mel/modules/encodec.py class ConvLayerNorm (line 23) | class ConvLayerNorm(nn.LayerNorm): method __init__ (line 28) | def __init__(self, normalized_shape: tp.Union[int, tp.List[int], torch... method forward (line 31) | def forward(self, x): function apply_parametrization_norm (line 42) | def apply_parametrization_norm(module: nn.Module, norm: str = 'none') ->... function get_norm_module (line 54) | def get_norm_module(module: nn.Module, causal: bool = False, norm: str =... function get_extra_padding_for_conv1d (line 71) | def get_extra_padding_for_conv1d(x: torch.Tensor, kernel_size: int, stri... function pad_for_conv1d (line 81) | def pad_for_conv1d(x: torch.Tensor, kernel_size: int, stride: int, paddi... function pad1d (line 96) | def pad1d(x: torch.Tensor, paddings: tp.Tuple[int, int], mode: str = 'ze... function unpad1d (line 116) | def unpad1d(x: torch.Tensor, paddings: tp.Tuple[int, int]): class NormConv1d (line 125) | class NormConv1d(nn.Module): method __init__ (line 129) | def __init__(self, *args, causal: bool = False, norm: str = 'none', method forward (line 136) | def forward(self, x): class NormConv2d (line 142) | class NormConv2d(nn.Module): method __init__ (line 146) | def __init__(self, *args, norm: str = 'none', method forward (line 153) | def forward(self, x): class NormConvTranspose1d (line 159) | class NormConvTranspose1d(nn.Module): method __init__ (line 163) | def __init__(self, *args, causal: bool = False, norm: str = 'none', method forward (line 170) | def forward(self, x): class NormConvTranspose2d (line 176) | class NormConvTranspose2d(nn.Module): method __init__ (line 180) | def __init__(self, *args, norm: str = 'none', method forward (line 186) | def forward(self, x): class SConv1d (line 192) | class SConv1d(nn.Module): method __init__ (line 196) | def __init__(self, in_channels: int, out_channels: int, method forward (line 212) | def forward(self, x): class SConvTranspose1d (line 231) | class SConvTranspose1d(nn.Module): method __init__ (line 235) | def __init__(self, in_channels: int, out_channels: int, method forward (line 248) | def forward(self, x): class SLSTM (line 272) | class SLSTM(nn.Module): method __init__ (line 277) | def __init__(self, dimension: int, num_layers: int = 2, skip: bool = T... method forward (line 283) | def forward(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/flow_matching.py class BASECFM (line 11) | class BASECFM(torch.nn.Module, ABC): method __init__ (line 12) | def __init__( method inference (line 31) | def inference(self, mu, x_lens, prompt, style, f0, n_timesteps, temper... method solve_euler (line 57) | def solve_euler(self, x, x_lens, prompt, mu, style, f0, t_span, infere... method forward (line 116) | def forward(self, x1, x_lens, prompt_lens, mu, style): class CFM (line 163) | class CFM(BASECFM): method __init__ (line 164) | def __init__(self, args): FILE: xinference/thirdparty/indextts/s2mel/modules/gpt_fast/generate.py function device_sync (line 16) | def device_sync(device): function multinomial_sample_one_no_sync (line 38) | def multinomial_sample_one_no_sync(probs_sort): # Does multinomial sampl... function logits_to_probs (line 42) | def logits_to_probs(logits, temperature: float = 1.0, top_k: Optional[in... function sample (line 52) | def sample(logits, temperature: float = 1.0, top_k: Optional[int] = None): function prefill (line 57) | def prefill(model: Transformer, x: torch.Tensor, input_pos: torch.Tensor... function decode_one_token (line 62) | def decode_one_token(model: Transformer, x: torch.Tensor, input_pos: tor... function decode_n_tokens (line 68) | def decode_n_tokens(model: Transformer, cur_token: torch.Tensor, input_p... function model_forward (line 84) | def model_forward(model, x, input_pos): function speculative_decode (line 87) | def speculative_decode( function generate (line 138) | def generate( function encode_tokens (line 208) | def encode_tokens(tokenizer, string, bos=True, device=default_device): function _load_model (line 214) | def _load_model(checkpoint_path, device, precision, use_tp): function _get_model_size (line 246) | def _get_model_size(model): function main (line 260) | def main( FILE: xinference/thirdparty/indextts/s2mel/modules/gpt_fast/model.py function find_multiple (line 15) | def find_multiple(n: int, k: int) -> int: class AdaptiveLayerNorm (line 20) | class AdaptiveLayerNorm(nn.Module): method __init__ (line 23) | def __init__(self, d_model, norm) -> None: method forward (line 30) | def forward(self, input: Tensor, embedding: Tensor = None) -> Tensor: class ModelArgs (line 42) | class ModelArgs: method __post_init__ (line 58) | def __post_init__(self): method from_name (line 68) | def from_name(cls, name: str): class KVCache (line 102) | class KVCache(nn.Module): method __init__ (line 103) | def __init__(self, max_batch_size, max_seq_length, n_heads, head_dim, ... method update (line 109) | def update(self, input_pos, k_val, v_val): class Transformer (line 121) | class Transformer(nn.Module): method __init__ (line 122) | def __init__(self, config: ModelArgs) -> None: method setup_caches (line 134) | def setup_caches(self, max_batch_size, max_seq_length, use_kv_cache=Tr... method forward (line 160) | def forward(self, method from_name (line 194) | def from_name(cls, name: str): class TransformerBlock (line 198) | class TransformerBlock(nn.Module): method __init__ (line 199) | def __init__(self, config: ModelArgs) -> None: method forward (line 221) | def forward(self, class Attention (line 242) | class Attention(nn.Module): method __init__ (line 243) | def __init__(self, config: ModelArgs, is_cross_attention: bool = False): method forward (line 270) | def forward(self, class FeedForward (line 311) | class FeedForward(nn.Module): method __init__ (line 312) | def __init__(self, config: ModelArgs) -> None: method forward (line 318) | def forward(self, x: Tensor) -> Tensor: class RMSNorm (line 322) | class RMSNorm(nn.Module): method __init__ (line 323) | def __init__(self, dim: int, eps: float = 1e-5): method _norm (line 328) | def _norm(self, x): method forward (line 331) | def forward(self, x: Tensor) -> Tensor: function precompute_freqs_cis (line 336) | def precompute_freqs_cis( function apply_rotary_emb (line 348) | def apply_rotary_emb(x: Tensor, freqs_cis: Tensor) -> Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/gpt_fast/quantize.py function dynamically_quantize_per_channel (line 24) | def dynamically_quantize_per_channel(x, quant_min, quant_max, target_dty... function get_group_qparams (line 58) | def get_group_qparams(w, n_bit=4, groupsize=128): function pack_scales_and_zeros (line 79) | def pack_scales_and_zeros(scales, zeros): function unpack_scales_and_zeros (line 96) | def unpack_scales_and_zeros(scales_and_zeros): function group_quantize_tensor_from_qparams (line 102) | def group_quantize_tensor_from_qparams(w, scales, zeros, n_bit=4, groups... function group_quantize_tensor (line 131) | def group_quantize_tensor(w, n_bit=4, groupsize=128): function group_dequantize_tensor_from_qparams (line 138) | def group_dequantize_tensor_from_qparams( function group_dequantize_tensor (line 158) | def group_dequantize_tensor(w_int32, scales_and_zeros, n_bit=4, groupsiz... class QuantHandler (line 164) | class QuantHandler: method __init__ (line 165) | def __init__(self, mod): method create_quantized_state_dict (line 168) | def create_quantized_state_dict(self) -> "StateDict": method convert_for_runtime (line 171) | def convert_for_runtime(self) -> "nn.Module": class GPTQQuantHandler (line 174) | class GPTQQuantHandler(QuantHandler): method __init__ (line 236) | def __init__(self): method get_inputs (line 245) | def get_inputs(model, tokenizer, calibration_tasks, calibration_limit,... method create_quantized_state_dict (line 275) | def create_quantized_state_dict( method convert_for_runtime (line 307) | def convert_for_runtime(self) -> "nn.Module": function replace_linear_weight_only_int8_per_channel (line 312) | def replace_linear_weight_only_int8_per_channel(module): class WeightOnlyInt8QuantHandler (line 319) | class WeightOnlyInt8QuantHandler: method __init__ (line 320) | def __init__(self, mod): method create_quantized_state_dict (line 324) | def create_quantized_state_dict(self): method convert_for_runtime (line 334) | def convert_for_runtime(self): class WeightOnlyInt8Linear (line 339) | class WeightOnlyInt8Linear(torch.nn.Module): method __init__ (line 345) | def __init__(self, in_features: int, out_features: int, bias: bool = T... method forward (line 354) | def forward(self, input: torch.Tensor) -> torch.Tensor: function prepare_int4_weight_and_scales_and_zeros (line 359) | def prepare_int4_weight_and_scales_and_zeros(weight_bf16, groupsize, inn... function linear_forward_int4 (line 367) | def linear_forward_int4(x, weight_int4pack, scales_and_zeros, out_featur... function _check_linear_int4_k (line 376) | def _check_linear_int4_k(k, groupsize = 1, inner_k_tiles = 1): function replace_linear_int4 (line 379) | def replace_linear_int4(module, groupsize, inner_k_tiles, padding): class WeightOnlyInt4QuantHandler (line 396) | class WeightOnlyInt4QuantHandler: method __init__ (line 397) | def __init__(self, mod, groupsize=128, inner_k_tiles=8, padding=True): method create_quantized_state_dict (line 406) | def create_quantized_state_dict(self, use_cuda = True): method convert_for_runtime (line 441) | def convert_for_runtime(self): class WeightOnlyInt4GPTQQuantHandler (line 445) | class WeightOnlyInt4GPTQQuantHandler(GPTQQuantHandler): method __init__ (line 446) | def __init__(self, mod, groupsize=128, inner_k_tiles=8, padding=True): method convert_for_runtime (line 479) | def convert_for_runtime(self): class WeightOnlyInt4Linear (line 483) | class WeightOnlyInt4Linear(torch.nn.Module): method __init__ (line 489) | def __init__( method forward (line 517) | def forward(self, input: torch.Tensor) -> torch.Tensor: function quantize (line 528) | def quantize( FILE: xinference/thirdparty/indextts/s2mel/modules/hifigan/f0_predictor.py class ConvRNNF0Predictor (line 19) | class ConvRNNF0Predictor(nn.Module): method __init__ (line 20) | def __init__(self, method forward (line 52) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/hifigan/generator.py class Snake (line 40) | class Snake(nn.Module): method __init__ (line 56) | def __init__(self, in_features, alpha=1.0, alpha_trainable=True, alpha... method forward (line 79) | def forward(self, x): function get_padding (line 92) | def get_padding(kernel_size, dilation=1): function init_weights (line 96) | def init_weights(m, mean=0.0, std=0.01): class ResBlock (line 103) | class ResBlock(torch.nn.Module): method __init__ (line 105) | def __init__( method forward (line 151) | def forward(self, x: torch.Tensor) -> torch.Tensor: method remove_weight_norm (line 160) | def remove_weight_norm(self): class SineGen (line 165) | class SineGen(torch.nn.Module): method __init__ (line 181) | def __init__(self, samp_rate, harmonic_num=0, method _f02uv (line 191) | def _f02uv(self, f0): method forward (line 197) | def forward(self, f0): class SourceModuleHnNSF (line 230) | class SourceModuleHnNSF(torch.nn.Module): method __init__ (line 248) | def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine... method forward (line 263) | def forward(self, x): class HiFTGenerator (line 282) | class HiFTGenerator(nn.Module): method __init__ (line 287) | def __init__( method _f02source (line 379) | def _f02source(self, f0: torch.Tensor) -> torch.Tensor: method _stft (line 385) | def _stft(self, x): method _istft (line 393) | def _istft(self, magnitude, phase): method forward (line 400) | def forward(self, x: torch.Tensor, f0=None) -> torch.Tensor: method remove_weight_norm (line 438) | def remove_weight_norm(self): method inference (line 453) | def inference(self, mel: torch.Tensor, f0=None) -> torch.Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/layers.py function _get_activation_fn (line 14) | def _get_activation_fn(activ): class LinearNorm (line 24) | class LinearNorm(torch.nn.Module): method __init__ (line 25) | def __init__(self, in_dim, out_dim, bias=True, w_init_gain='linear'): method forward (line 33) | def forward(self, x): class ConvNorm (line 37) | class ConvNorm(torch.nn.Module): method __init__ (line 38) | def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, method forward (line 53) | def forward(self, signal): class CausualConv (line 57) | class CausualConv(nn.Module): method __init__ (line 58) | def __init__(self, in_channels, out_channels, kernel_size=1, stride=1,... method forward (line 74) | def forward(self, x): class CausualBlock (line 79) | class CausualBlock(nn.Module): method __init__ (line 80) | def __init__(self, hidden_dim, n_conv=3, dropout_p=0.2, activ='lrelu'): method forward (line 86) | def forward(self, x): method _get_conv (line 93) | def _get_conv(self, hidden_dim, dilation, activ='lrelu', dropout_p=0.2): class ConvBlock (line 105) | class ConvBlock(nn.Module): method __init__ (line 106) | def __init__(self, hidden_dim, n_conv=3, dropout_p=0.2, activ='relu'): method forward (line 114) | def forward(self, x): method _get_conv (line 121) | def _get_conv(self, hidden_dim, dilation, activ='relu', dropout_p=0.2): class LocationLayer (line 133) | class LocationLayer(nn.Module): method __init__ (line 134) | def __init__(self, attention_n_filters, attention_kernel_size, method forward (line 145) | def forward(self, attention_weights_cat): class Attention (line 152) | class Attention(nn.Module): method __init__ (line 153) | def __init__(self, attention_rnn_dim, embedding_dim, attention_dim, method get_alignment_energies (line 166) | def get_alignment_energies(self, query, processed_memory, method forward (line 187) | def forward(self, attention_hidden_state, memory, processed_memory, class ForwardAttentionV2 (line 211) | class ForwardAttentionV2(nn.Module): method __init__ (line 212) | def __init__(self, attention_rnn_dim, embedding_dim, attention_dim, method get_alignment_energies (line 225) | def get_alignment_energies(self, query, processed_memory, method forward (line 246) | def forward(self, attention_hidden_state, memory, processed_memory, class PhaseShuffle2d (line 293) | class PhaseShuffle2d(nn.Module): method __init__ (line 294) | def __init__(self, n=2): method forward (line 299) | def forward(self, x, move=None): class PhaseShuffle1d (line 312) | class PhaseShuffle1d(nn.Module): method __init__ (line 313) | def __init__(self, n=2): method forward (line 318) | def forward(self, x, move=None): class MFCC (line 332) | class MFCC(nn.Module): method __init__ (line 333) | def __init__(self, n_mfcc=40, n_mels=80): method forward (line 341) | def forward(self, mel_specgram): FILE: xinference/thirdparty/indextts/s2mel/modules/length_regulator.py function f0_to_coarse (line 15) | def f0_to_coarse(f0, f0_bin): class InterpolateRegulator (line 28) | class InterpolateRegulator(nn.Module): method __init__ (line 29) | def __init__( method forward (line 90) | def forward(self, x, ylens=None, n_quantizers=None, f0=None): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/api.py class OpenVoiceBaseClass (line 14) | class OpenVoiceBaseClass(object): method __init__ (line 15) | def __init__(self, method load_ckpt (line 35) | def load_ckpt(self, ckpt_path): class BaseSpeakerTTS (line 42) | class BaseSpeakerTTS(OpenVoiceBaseClass): method get_text (line 49) | def get_text(text, hps, is_symbol): method audio_numpy_concat (line 57) | def audio_numpy_concat(segment_data_list, sr, speed=1.): method split_segments_into_pieces (line 66) | def split_segments_into_pieces(text, language_str): method tts (line 73) | def tts(self, text, output_path, speaker, language='English', speed=1.0): class ToneColorConverter (line 101) | class ToneColorConverter(OpenVoiceBaseClass): method __init__ (line 102) | def __init__(self, *args, **kwargs): method extract_se (line 114) | def extract_se(self, waves, wave_lengths): method convert (line 133) | def convert(self, src_waves, src_wave_lengths, src_se, tgt_se, tau=0.3... method add_watermark (line 146) | def add_watermark(self, audio, message): method detect_watermark (line 170) | def detect_watermark(self, audio, n_repeat): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/attentions.py class LayerNorm (line 12) | class LayerNorm(nn.Module): method __init__ (line 13) | def __init__(self, channels, eps=1e-5): method forward (line 21) | def forward(self, x): function fused_add_tanh_sigmoid_multiply (line 28) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): class Encoder (line 37) | class Encoder(nn.Module): method __init__ (line 38) | def __init__( method forward (line 104) | def forward(self, x, x_mask, g=None): class Decoder (line 124) | class Decoder(nn.Module): method __init__ (line 125) | def __init__( method forward (line 184) | def forward(self, x, x_mask, h, h_mask): class MultiHeadAttention (line 210) | class MultiHeadAttention(nn.Module): method __init__ (line 211) | def __init__( method forward (line 264) | def forward(self, x, c, attn_mask=None): method attention (line 274) | def attention(self, query, key, value, mask=None): method _matmul_with_relative_values (line 325) | def _matmul_with_relative_values(self, x, y): method _matmul_with_relative_keys (line 334) | def _matmul_with_relative_keys(self, x, y): method _get_relative_embeddings (line 343) | def _get_relative_embeddings(self, relative_embeddings, length): method _relative_position_to_absolute_position (line 361) | def _relative_position_to_absolute_position(self, x): method _absolute_position_to_relative_position (line 382) | def _absolute_position_to_relative_position(self, x): method _attention_bias_proximal (line 398) | def _attention_bias_proximal(self, length): class FFN (line 410) | class FFN(nn.Module): method __init__ (line 411) | def __init__( method forward (line 439) | def forward(self, x, x_mask): method _causal_padding (line 449) | def _causal_padding(self, x): method _same_padding (line 458) | def _same_padding(self, x): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/commons.py function init_weights (line 6) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 12) | def get_padding(kernel_size, dilation=1): function convert_pad_shape (line 16) | def convert_pad_shape(pad_shape): function intersperse (line 22) | def intersperse(lst, item): function kl_divergence (line 28) | def kl_divergence(m_p, logs_p, m_q, logs_q): function rand_gumbel (line 37) | def rand_gumbel(shape): function rand_gumbel_like (line 43) | def rand_gumbel_like(x): function slice_segments (line 48) | def slice_segments(x, ids_str, segment_size=4): function rand_slice_segments (line 57) | def rand_slice_segments(x, x_lengths=None, segment_size=4): function get_timing_signal_1d (line 67) | def get_timing_signal_1d(length, channels, min_timescale=1.0, max_timesc... function add_timing_signal_1d (line 83) | def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4): function cat_timing_signal_1d (line 89) | def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis... function subsequent_mask (line 95) | def subsequent_mask(length): function fused_add_tanh_sigmoid_multiply (line 101) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): function convert_pad_shape (line 110) | def convert_pad_shape(pad_shape): function shift_1d (line 116) | def shift_1d(x): function sequence_mask (line 121) | def sequence_mask(length, max_length=None): function generate_path (line 128) | def generate_path(duration, mask): function clip_grad_value_ (line 145) | def clip_grad_value_(parameters, clip_value, norm_type=2): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/mel_processing.py function dynamic_range_compression_torch (line 8) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 17) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 26) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 31) | def spectral_de_normalize_torch(magnitudes): function spectrogram_torch (line 40) | def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, cente... function spectrogram_torch_conv (line 78) | def spectrogram_torch_conv(y, n_fft, sampling_rate, hop_size, win_size, ... function spec_to_mel_torch (line 122) | def spec_to_mel_torch(spec, n_fft, num_mels, sampling_rate, fmin, fmax): function mel_spectrogram_torch (line 136) | def mel_spectrogram_torch( FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/models.py class TextEncoder (line 16) | class TextEncoder(nn.Module): method __init__ (line 17) | def __init__(self, method forward (line 48) | def forward(self, x, x_lengths): class DurationPredictor (line 60) | class DurationPredictor(nn.Module): method __init__ (line 61) | def __init__( method forward (line 86) | def forward(self, x, x_mask, g=None): class StochasticDurationPredictor (line 102) | class StochasticDurationPredictor(nn.Module): method __init__ (line 103) | def __init__(self, in_channels, filter_channels, kernel_size, p_dropou... method forward (line 135) | def forward(self, x, x_mask, w=None, g=None, reverse=False, noise_scal... class PosteriorEncoder (line 182) | class PosteriorEncoder(nn.Module): method __init__ (line 183) | def __init__( method forward (line 212) | def forward(self, x, x_lengths, g=None, tau=1.0): class Generator (line 224) | class Generator(torch.nn.Module): method __init__ (line 225) | def __init__( method forward (line 272) | def forward(self, x, g=None): method remove_weight_norm (line 293) | def remove_weight_norm(self): class ReferenceEncoder (line 301) | class ReferenceEncoder(nn.Module): method __init__ (line 307) | def __init__(self, spec_channels, gin_channels=0, layernorm=True): method forward (line 339) | def forward(self, inputs, mask=None): method calculate_channels (line 361) | def calculate_channels(self, L, kernel_size, stride, pad, n_convs): class ResidualCouplingBlock (line 367) | class ResidualCouplingBlock(nn.Module): method __init__ (line 368) | def __init__(self, method forward (line 390) | def forward(self, x, x_mask, g=None, reverse=False): class SynthesizerTrn (line 399) | class SynthesizerTrn(nn.Module): method __init__ (line 404) | def __init__( method infer (line 467) | def infer(self, x, x_lengths, sid=None, noise_scale=1, length_scale=1,... method voice_conversion (line 492) | def voice_conversion(self, y, y_lengths, sid_src, sid_tgt, tau=1.0): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/modules.py class LayerNorm (line 17) | class LayerNorm(nn.Module): method __init__ (line 18) | def __init__(self, channels, eps=1e-5): method forward (line 26) | def forward(self, x): class ConvReluNorm (line 32) | class ConvReluNorm(nn.Module): method __init__ (line 33) | def __init__( method forward (line 74) | def forward(self, x, x_mask): class DDSConv (line 84) | class DDSConv(nn.Module): method __init__ (line 89) | def __init__(self, channels, kernel_size, n_layers, p_dropout=0.0): method forward (line 118) | def forward(self, x, x_mask, g=None): class WN (line 133) | class WN(torch.nn.Module): method __init__ (line 134) | def __init__( method forward (line 185) | def forward(self, x, x_mask, g=None, **kwargs): method remove_weight_norm (line 212) | def remove_weight_norm(self): class ResBlock1 (line 221) | class ResBlock1(torch.nn.Module): method __init__ (line 222) | def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)): method forward (line 296) | def forward(self, x, x_mask=None): method remove_weight_norm (line 311) | def remove_weight_norm(self): class ResBlock2 (line 318) | class ResBlock2(torch.nn.Module): method __init__ (line 319) | def __init__(self, channels, kernel_size=3, dilation=(1, 3)): method forward (line 347) | def forward(self, x, x_mask=None): method remove_weight_norm (line 358) | def remove_weight_norm(self): class Log (line 363) | class Log(nn.Module): method forward (line 364) | def forward(self, x, x_mask, reverse=False, **kwargs): class Flip (line 374) | class Flip(nn.Module): method forward (line 375) | def forward(self, x, *args, reverse=False, **kwargs): class ElementwiseAffine (line 384) | class ElementwiseAffine(nn.Module): method __init__ (line 385) | def __init__(self, channels): method forward (line 391) | def forward(self, x, x_mask, reverse=False, **kwargs): class ResidualCouplingLayer (line 402) | class ResidualCouplingLayer(nn.Module): method __init__ (line 403) | def __init__( method forward (line 437) | def forward(self, x, x_mask, g=None, reverse=False): class ConvFlow (line 459) | class ConvFlow(nn.Module): method __init__ (line 460) | def __init__( method forward (line 486) | def forward(self, x, x_mask, g=None, reverse=False): class TransformerCouplingLayer (line 519) | class TransformerCouplingLayer(nn.Module): method __init__ (line 520) | def __init__( method forward (line 562) | def forward(self, x, x_mask, g=None, reverse=False): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/openvoice_app.py function predict (line 37) | def predict(prompt, style, audio_file_pth, agree): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/se_extractor.py function split_audio_whisper (line 19) | def split_audio_whisper(audio_path, audio_name, target_dir='processed'): function split_audio_vad (line 77) | def split_audio_vad(audio_path, audio_name, target_dir, split_seconds=10... function hash_numpy_array (line 118) | def hash_numpy_array(audio_path): function get_se (line 129) | def get_se(audio_path, vc_model, target_dir='processed', vad=True): FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/transforms.py function piecewise_rational_quadratic_transform (line 12) | def piecewise_rational_quadratic_transform( function searchsorted (line 45) | def searchsorted(bin_locations, inputs, eps=1e-6): function unconstrained_rational_quadratic_spline (line 50) | def unconstrained_rational_quadratic_spline( function rational_quadratic_spline (line 100) | def rational_quadratic_spline( FILE: xinference/thirdparty/indextts/s2mel/modules/openvoice/utils.py function get_hparams_from_file (line 6) | def get_hparams_from_file(config_path): class HParams (line 14) | class HParams: method __init__ (line 15) | def __init__(self, **kwargs): method keys (line 21) | def keys(self): method items (line 24) | def items(self): method values (line 27) | def values(self): method __len__ (line 30) | def __len__(self): method __getitem__ (line 33) | def __getitem__(self, key): method __setitem__ (line 36) | def __setitem__(self, key, value): method __contains__ (line 39) | def __contains__(self, key): method __repr__ (line 42) | def __repr__(self): function string_to_bits (line 46) | def string_to_bits(string, pad_len=8): function bits_to_string (line 65) | def bits_to_string(bits_array): function split_segment (line 78) | def split_segment(text, min_len=10, language_str='[EN]'): function split_segments_latin (line 85) | def split_segments_latin(text, min_len=10): function merge_short_segments_latin (line 120) | def merge_short_segments_latin(sens): function split_segments_zh (line 145) | def split_segments_zh(text, min_len=10): function merge_short_segments_zh (line 170) | def merge_short_segments_zh(sens): FILE: xinference/thirdparty/indextts/s2mel/modules/quantize.py function init_weights (line 14) | def init_weights(m): function WNConv1d (line 20) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 24) | def WNConvTranspose1d(*args, **kwargs): class SnakeBeta (line 27) | class SnakeBeta(nn.Module): method __init__ (line 45) | def __init__( method forward (line 75) | def forward(self, x): class ResidualUnit (line 90) | class ResidualUnit(nn.Module): method __init__ (line 91) | def __init__(self, dim: int = 16, dilation: int = 1): method forward (line 101) | def forward(self, x): class CNNLSTM (line 104) | class CNNLSTM(nn.Module): method __init__ (line 105) | def __init__(self, indim, outdim, head, global_pred=False): method forward (line 117) | def forward(self, x): function sequence_mask (line 125) | def sequence_mask(length, max_length=None): class FAquantizer (line 130) | class FAquantizer(nn.Module): method __init__ (line 131) | def __init__(self, in_dim=1024, method preprocess (line 190) | def preprocess(self, wave_tensor, n_bins=20): method forward (line 195) | def forward(self, x, wave_segments): FILE: xinference/thirdparty/indextts/s2mel/modules/rmvpe.py class STFT (line 17) | class STFT(torch.nn.Module): method __init__ (line 18) | def __init__( method transform (line 66) | def transform(self, input_data, return_phase=False): method inverse (line 97) | def inverse(self, magnitude, phase): method forward (line 132) | def forward(self, input_data): class BiGRU (line 150) | class BiGRU(nn.Module): method __init__ (line 151) | def __init__(self, input_features, hidden_features, num_layers): method forward (line 161) | def forward(self, x): class ConvBlockRes (line 165) | class ConvBlockRes(nn.Module): method __init__ (line 166) | def __init__(self, in_channels, out_channels, momentum=0.01): method forward (line 194) | def forward(self, x: torch.Tensor): class Encoder (line 201) | class Encoder(nn.Module): method __init__ (line 202) | def __init__( method forward (line 230) | def forward(self, x: torch.Tensor): class ResEncoderBlock (line 239) | class ResEncoderBlock(nn.Module): method __init__ (line 240) | def __init__( method forward (line 253) | def forward(self, x): class Intermediate (line 262) | class Intermediate(nn.Module): # method __init__ (line 263) | def __init__(self, in_channels, out_channels, n_inters, n_blocks, mome... method forward (line 275) | def forward(self, x): class ResDecoderBlock (line 281) | class ResDecoderBlock(nn.Module): method __init__ (line 282) | def __init__(self, in_channels, out_channels, stride, n_blocks=1, mome... method forward (line 304) | def forward(self, x, concat_tensor): class Decoder (line 312) | class Decoder(nn.Module): method __init__ (line 313) | def __init__(self, in_channels, n_decoders, stride, n_blocks, momentum... method forward (line 324) | def forward(self, x: torch.Tensor, concat_tensors: List[torch.Tensor]): class DeepUnet (line 330) | class DeepUnet(nn.Module): method __init__ (line 331) | def __init__( method forward (line 354) | def forward(self, x: torch.Tensor) -> torch.Tensor: class E2E (line 361) | class E2E(nn.Module): method __init__ (line 362) | def __init__( method forward (line 394) | def forward(self, mel): class MelSpectrogram (line 406) | class MelSpectrogram(torch.nn.Module): method __init__ (line 407) | def __init__( method forward (line 440) | def forward(self, audio, keyshift=0, speed=1, center=True): class RMVPE (line 483) | class RMVPE: method __init__ (line 484) | def __init__(self, model_path: str, is_half, device=None, use_jit=False): method mel2hidden (line 523) | def mel2hidden(self, mel): method decode (line 541) | def decode(self, hidden, thred=0.03): method infer_from_audio (line 548) | def infer_from_audio(self, audio, thred=0.03): method infer_from_audio_batch (line 575) | def infer_from_audio_batch(self, audio, thred=0.03): method to_local_average_cents (line 607) | def to_local_average_cents(self, salience, thred=0.05): FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/heads.py class FourierHead (line 11) | class FourierHead(nn.Module): method forward (line 14) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ISTFTHead (line 26) | class ISTFTHead(FourierHead): method __init__ (line 38) | def __init__(self, dim: int, n_fft: int, hop_length: int, padding: str... method forward (line 44) | def forward(self, x: torch.Tensor) -> torch.Tensor: class IMDCTSymExpHead (line 72) | class IMDCTSymExpHead(FourierHead): method __init__ (line 85) | def __init__( method forward (line 109) | def forward(self, x: torch.Tensor) -> torch.Tensor: class IMDCTCosHead (line 130) | class IMDCTCosHead(FourierHead): method __init__ (line 141) | def __init__(self, dim: int, mdct_frame_len: int, padding: str = "same... method forward (line 147) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/helpers.py function save_figure_to_numpy (line 10) | def save_figure_to_numpy(fig: plt.Figure) -> np.ndarray: function plot_spectrogram_to_numpy (line 25) | def plot_spectrogram_to_numpy(spectrogram: np.ndarray) -> np.ndarray: class GradNormCallback (line 49) | class GradNormCallback(Callback): method on_after_backward (line 54) | def on_after_backward(self, trainer, model): function gradient_norm (line 58) | def gradient_norm(model: torch.nn.Module, norm_type: float = 2.0) -> tor... FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/loss.py class MelSpecReconstructionLoss (line 10) | class MelSpecReconstructionLoss(nn.Module): method __init__ (line 15) | def __init__( method forward (line 23) | def forward(self, y_hat, y) -> torch.Tensor: class GeneratorLoss (line 40) | class GeneratorLoss(nn.Module): method forward (line 45) | def forward(self, disc_outputs: List[torch.Tensor]) -> Tuple[torch.Ten... class DiscriminatorLoss (line 64) | class DiscriminatorLoss(nn.Module): method forward (line 69) | def forward( class FeatureMatchingLoss (line 95) | class FeatureMatchingLoss(nn.Module): method forward (line 100) | def forward(self, fmap_r: List[List[torch.Tensor]], fmap_g: List[List[... FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/models.py class Backbone (line 10) | class Backbone(nn.Module): method forward (line 13) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class VocosBackbone (line 26) | class VocosBackbone(Backbone): method __init__ (line 40) | def __init__( method _init_weights (line 72) | def _init_weights(self, m): method forward (line 77) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class VocosResNetBackbone (line 92) | class VocosResNetBackbone(Backbone): method __init__ (line 103) | def __init__( method forward (line 114) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/modules.py class ConvNeXtBlock (line 8) | class ConvNeXtBlock(nn.Module): method __init__ (line 20) | def __init__( method forward (line 43) | def forward(self, x: torch.Tensor, cond_embedding_id: Optional[torch.T... class AdaLayerNorm (line 63) | class AdaLayerNorm(nn.Module): method __init__ (line 72) | def __init__(self, num_embeddings: int, embedding_dim: int, eps: float... method forward (line 81) | def forward(self, x: torch.Tensor, cond_embedding_id: torch.Tensor) ->... class ResBlock1 (line 89) | class ResBlock1(nn.Module): method __init__ (line 105) | def __init__( method forward (line 172) | def forward(self, x: torch.Tensor) -> torch.Tensor: method remove_weight_norm (line 183) | def remove_weight_norm(self): method get_padding (line 190) | def get_padding(kernel_size: int, dilation: int = 1) -> int: function safe_log (line 194) | def safe_log(x: torch.Tensor, clip_val: float = 1e-7) -> torch.Tensor: function symlog (line 208) | def symlog(x: torch.Tensor) -> torch.Tensor: function symexp (line 212) | def symexp(x: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/pretrained.py class Vocos (line 12) | class Vocos(nn.Module): method __init__ (line 20) | def __init__( method forward (line 37) | def forward(self, features_input: torch.Tensor, **kwargs: Any) -> torc... FILE: xinference/thirdparty/indextts/s2mel/modules/vocos/spectral_ops.py class ISTFT (line 7) | class ISTFT(nn.Module): method __init__ (line 22) | def __init__(self, n_fft: int, hop_length: int, win_length: int, paddi... method forward (line 33) | def forward(self, spec: torch.Tensor) -> torch.Tensor: class MDCT (line 78) | class MDCT(nn.Module): method __init__ (line 87) | def __init__(self, frame_len: int, padding: str = "same"): method forward (line 105) | def forward(self, audio: torch.Tensor) -> torch.Tensor: class IMDCT (line 133) | class IMDCT(nn.Module): method __init__ (line 142) | def __init__(self, frame_len: int, padding: str = "same"): method forward (line 158) | def forward(self, X: torch.Tensor) -> torch.Tensor: FILE: xinference/thirdparty/indextts/s2mel/modules/wavenet.py class LayerNorm (line 11) | class LayerNorm(nn.Module): method __init__ (line 12) | def __init__(self, channels, eps=1e-5): method forward (line 20) | def forward(self, x): class ConvReluNorm (line 26) | class ConvReluNorm(nn.Module): method __init__ (line 27) | def __init__(self, in_channels, hidden_channels, out_channels, kernel_... method forward (line 51) | def forward(self, x, x_mask): class DDSConv (line 61) | class DDSConv(nn.Module): method __init__ (line 66) | def __init__(self, channels, kernel_size, n_layers, p_dropout=0.): method forward (line 88) | def forward(self, x, x_mask, g=None): class WN (line 103) | class WN(torch.nn.Module): method __init__ (line 104) | def __init__(self, hidden_channels, kernel_size, dilation_rate, n_laye... method forward (line 138) | def forward(self, x, x_mask, g=None, **kwargs): method remove_weight_norm (line 168) | def remove_weight_norm(self): FILE: xinference/thirdparty/indextts/s2mel/optimizers.py class MultiOptimizer (line 11) | class MultiOptimizer: method __init__ (line 12) | def __init__(self, optimizers={}, schedulers={}): method state_dict (line 18) | def state_dict(self): method scheduler_state_dict (line 23) | def scheduler_state_dict(self): method load_state_dict (line 28) | def load_state_dict(self, state_dict): method load_scheduler_state_dict (line 35) | def load_scheduler_state_dict(self, state_dict): method step (line 42) | def step(self, key=None, scaler=None): method _step (line 46) | def _step(self, key, scaler=None): method zero_grad (line 53) | def zero_grad(self, key=None): method scheduler (line 59) | def scheduler(self, *args, key=None): function define_scheduler (line 65) | def define_scheduler(optimizer, params): function build_optimizer (line 70) | def build_optimizer(model_dict, lr, type='AdamW'): FILE: xinference/thirdparty/indextts/s2mel/wav2vecbert_extract.py class JsonHParams (line 17) | class JsonHParams: method __init__ (line 18) | def __init__(self, **kwargs): method keys (line 24) | def keys(self): method items (line 27) | def items(self): method values (line 30) | def values(self): method __len__ (line 33) | def __len__(self): method __getitem__ (line 36) | def __getitem__(self, key): method __setitem__ (line 39) | def __setitem__(self, key, value): method __contains__ (line 42) | def __contains__(self, key): method __repr__ (line 45) | def __repr__(self): function _load_config (line 49) | def _load_config(config_fn, lowercase=False): function load_config (line 73) | def load_config(config_fn, lowercase=False): class Extract_wav2vectbert (line 88) | class Extract_wav2vectbert: method __init__ (line 89) | def __init__(self,device): method extract_features (line 112) | def extract_features(self, speech): # speech [b,T] method extract_semantic_code (line 119) | def extract_semantic_code(self, input_features, attention_mask): method feature_extract (line 131) | def feature_extract(self, prompt_speech): FILE: xinference/thirdparty/indextts/utils/arch_util.py function zero_module (line 9) | def zero_module(module): class GroupNorm32 (line 18) | class GroupNorm32(nn.GroupNorm): method forward (line 19) | def forward(self, x): function normalization (line 23) | def normalization(channels): class QKVAttentionLegacy (line 41) | class QKVAttentionLegacy(nn.Module): method __init__ (line 46) | def __init__(self, n_heads): method forward (line 50) | def forward(self, qkv, mask=None, rel_pos=None): class AttentionBlock (line 77) | class AttentionBlock(nn.Module): method __init__ (line 85) | def __init__( method forward (line 114) | def forward(self, x, mask=None): FILE: xinference/thirdparty/indextts/utils/checkpoint.py function load_checkpoint (line 25) | def load_checkpoint(model: torch.nn.Module, model_pth: str) -> dict: FILE: xinference/thirdparty/indextts/utils/common.py function load_audio (line 11) | def load_audio(audiopath, sampling_rate): function tokenize_by_CJK_char (line 29) | def tokenize_by_CJK_char(line: str, do_upper_case=True) -> str: function de_tokenized_by_CJK_char (line 54) | def de_tokenized_by_CJK_char(line: str, do_lower_case=False) -> str: function make_pad_mask (line 84) | def make_pad_mask(lengths: torch.Tensor, max_len: int = 0) -> torch.Tensor: function safe_log (line 110) | def safe_log(x: torch.Tensor, clip_val: float = 1e-7) -> torch.Tensor: FILE: xinference/thirdparty/indextts/utils/feature_extractors.py class FeatureExtractor (line 7) | class FeatureExtractor(nn.Module): method forward (line 10) | def forward(self, audio: torch.Tensor, **kwargs) -> torch.Tensor: class MelSpectrogramFeatures (line 24) | class MelSpectrogramFeatures(FeatureExtractor): method __init__ (line 25) | def __init__(self, sample_rate=24000, n_fft=1024, hop_length=256, win_... method forward (line 44) | def forward(self, audio, **kwargs): FILE: xinference/thirdparty/indextts/utils/front.py class TextNormalizer (line 11) | class TextNormalizer: method __init__ (line 12) | def __init__(self): method match_email (line 57) | def match_email(self, email): method use_chinese (line 78) | def use_chinese(self, s): method load (line 88) | def load(self): method normalize (line 113) | def normalize(self, text: str) -> str: method correct_pinyin (line 144) | def correct_pinyin(self, pinyin: str): method save_names (line 157) | def save_names(self, original_text): method restore_names (line 176) | def restore_names(self, normalized_text, original_name_list): method save_pinyin_tones (line 191) | def save_pinyin_tones(self, original_text): method restore_pinyin_tones (line 212) | def restore_pinyin_tones(self, normalized_text, original_pinyin_list): class TextTokenizer (line 231) | class TextTokenizer: method __init__ (line 232) | def __init__(self, vocab_file: str, normalizer: TextNormalizer = None): method vocab_size (line 251) | def vocab_size(self): method unk_token (line 255) | def unk_token(self): method pad_token (line 259) | def pad_token(self): method bos_token (line 263) | def bos_token(self): method eos_token (line 267) | def eos_token(self): method pad_token_id (line 271) | def pad_token_id(self): method bos_token_id (line 275) | def bos_token_id(self): method eos_token_id (line 279) | def eos_token_id(self): method unk_token_id (line 283) | def unk_token_id(self): method special_tokens_map (line 287) | def special_tokens_map(self): method get_vocab (line 295) | def get_vocab(self): method convert_ids_to_tokens (line 300) | def convert_ids_to_tokens(self, ids: int) -> str: ... method convert_ids_to_tokens (line 303) | def convert_ids_to_tokens(self, ids: List[int]) -> List[str]: ... method convert_ids_to_tokens (line 305) | def convert_ids_to_tokens(self, ids: Union[List[int], int]): method convert_tokens_to_ids (line 308) | def convert_tokens_to_ids(self, tokens: Union[List[str], str]) -> List... method tokenize (line 313) | def tokenize(self, text: str) -> List[str]: method encode (line 316) | def encode(self, text: str, **kwargs): method batch_encode (line 329) | def batch_encode(self, texts: List[str], **kwargs): method decode (line 338) | def decode(self, ids: Union[List[int], int], do_lower_case=False, **kw... method split_segments_by_token (line 345) | def split_segments_by_token( method split_segments (line 425) | def split_segments(self, tokenized: List[str], max_text_tokens_per_seg... FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/amphion_codec/codec.py function WNConv1d (line 24) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 28) | def WNConvTranspose1d(*args, **kwargs): function snake (line 34) | def snake(x, alpha): class Snake1d (line 42) | class Snake1d(nn.Module): method __init__ (line 43) | def __init__(self, channels): method forward (line 47) | def forward(self, x): function init_weights (line 51) | def init_weights(m): class ResidualUnit (line 60) | class ResidualUnit(nn.Module): method __init__ (line 61) | def __init__(self, dim: int = 16, dilation: int = 1): method forward (line 71) | def forward(self, x): class EncoderBlock (line 79) | class EncoderBlock(nn.Module): method __init__ (line 80) | def __init__(self, dim: int = 16, stride: int = 1): method forward (line 96) | def forward(self, x): class CodecEncoder (line 100) | class CodecEncoder(nn.Module): method __init__ (line 101) | def __init__( method forward (line 139) | def forward(self, x): method reset_parameters (line 142) | def reset_parameters(self): class DecoderBlock (line 146) | class DecoderBlock(nn.Module): method __init__ (line 147) | def __init__(self, input_dim: int = 16, output_dim: int = 8, stride: i... method forward (line 164) | def forward(self, x): class CodecDecoder (line 168) | class CodecDecoder(nn.Module): method __init__ (line 169) | def __init__( method forward (line 386) | def forward(self, x=None, vq=False, eval_vq=False, n_quantizers=None): method quantize (line 411) | def quantize(self, x, n_quantizers=None): method vq2emb (line 417) | def vq2emb(self, vq, n_quantizers=None): method decode (line 420) | def decode(self, x): method latent2dist (line 423) | def latent2dist(self, x, n_quantizers=None): method reset_parameters (line 426) | def reset_parameters(self): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/amphion_codec/quantize/factorized_vector_quantize.py function WNConv1d (line 14) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 18) | def WNConvTranspose1d(*args, **kwargs): class FactorizedVectorQuantize (line 22) | class FactorizedVectorQuantize(nn.Module): method __init__ (line 23) | def __init__( method forward (line 52) | def forward(self, z): method embed_code (line 96) | def embed_code(self, embed_id): method decode_code (line 99) | def decode_code(self, embed_id): method decode_latents (line 102) | def decode_latents(self, latents): method vq2emb (line 123) | def vq2emb(self, vq, out_proj=True): method latent2dist (line 129) | def latent2dist(self, latents): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/amphion_codec/quantize/lookup_free_quantize.py function WNConv1d (line 14) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 18) | def WNConvTranspose1d(*args, **kwargs): class LookupFreeQuantize (line 22) | class LookupFreeQuantize(nn.Module): method __init__ (line 23) | def __init__( method forward (line 46) | def forward(self, z): method vq2emb (line 68) | def vq2emb(self, vq, out_proj=True): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/amphion_codec/quantize/residual_vq.py class ResidualVQ (line 22) | class ResidualVQ(nn.Module): method __init__ (line 28) | def __init__( method forward (line 68) | def forward(self, z, n_quantizers: int = None): method vq2emb (line 144) | def vq2emb(self, vq, n_quantizers=None): method latent2dist (line 154) | def latent2dist(self, z, n_quantizers=None): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/amphion_codec/quantize/vector_quantize.py function WNConv1d (line 14) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 18) | def WNConvTranspose1d(*args, **kwargs): function l2norm (line 22) | def l2norm(t): function ema_inplace (line 26) | def ema_inplace(moving_avg, new, decay): function laplace_smoothing (line 30) | def laplace_smoothing(x, n_categories, eps=1e-5): function sample_vectors (line 34) | def sample_vectors(samples, num): function kmeans (line 45) | def kmeans(samples, num_clusters, num_iters=10, use_cosine_sim=False): class EuclideanCodebook (line 76) | class EuclideanCodebook(nn.Module): method __init__ (line 77) | def __init__( method init_embed_ (line 109) | def init_embed_(self, data): method replace (line 116) | def replace(self, samples, mask): method expire_codes_ (line 122) | def expire_codes_(self, batch_samples): method forward (line 132) | def forward(self, x): method vq2emb (line 167) | def vq2emb(self, vq): method latent2dist (line 171) | def latent2dist(self, x): class SimpleCodebook (line 194) | class SimpleCodebook(nn.Module): method __init__ (line 195) | def __init__( method forward (line 209) | def forward(self, x): method vq2emb (line 230) | def vq2emb(self, vq): method latent2dist (line 234) | def latent2dist(self, x): class VectorQuantize (line 258) | class VectorQuantize(nn.Module): method __init__ (line 278) | def __init__( method forward (line 341) | def forward(self, z): method decode_latents (line 385) | def decode_latents(self, latents): method vq2emb (line 391) | def vq2emb(self, vq, out_proj=True): method latent2dist (line 398) | def latent2dist(self, latents): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/amphion_codec/vocos.py function safe_log (line 18) | def safe_log(x: torch.Tensor, clip_val: float = 1e-7) -> torch.Tensor: function symlog (line 32) | def symlog(x: torch.Tensor) -> torch.Tensor: function symexp (line 36) | def symexp(x: torch.Tensor) -> torch.Tensor: class STFT (line 40) | class STFT(nn.Module): method __init__ (line 41) | def __init__( method forward (line 56) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ISTFT (line 84) | class ISTFT(nn.Module): method __init__ (line 99) | def __init__( method forward (line 112) | def forward(self, spec: torch.Tensor) -> torch.Tensor: class MDCT (line 170) | class MDCT(nn.Module): method __init__ (line 179) | def __init__(self, frame_len: int, padding: str = "same"): method forward (line 197) | def forward(self, audio: torch.Tensor) -> torch.Tensor: class IMDCT (line 231) | class IMDCT(nn.Module): method __init__ (line 240) | def __init__(self, frame_len: int, padding: str = "same"): method forward (line 256) | def forward(self, X: torch.Tensor) -> torch.Tensor: class FourierHead (line 299) | class FourierHead(nn.Module): method forward (line 302) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ISTFTHead (line 314) | class ISTFTHead(FourierHead): method __init__ (line 326) | def __init__(self, dim: int, n_fft: int, hop_length: int, padding: str... method forward (line 334) | def forward(self, x: torch.Tensor) -> torch.Tensor: class IMDCTSymExpHead (line 364) | class IMDCTSymExpHead(FourierHead): method __init__ (line 377) | def __init__( method forward (line 401) | def forward(self, x: torch.Tensor) -> torch.Tensor: class IMDCTCosHead (line 424) | class IMDCTCosHead(FourierHead): method __init__ (line 435) | def __init__( method forward (line 447) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ConvNeXtBlock (line 469) | class ConvNeXtBlock(nn.Module): method __init__ (line 481) | def __init__( method forward (line 508) | def forward( class AdaLayerNorm (line 530) | class AdaLayerNorm(nn.Module): method __init__ (line 539) | def __init__(self, num_embeddings: int, embedding_dim: int, eps: float... method forward (line 552) | def forward(self, x: torch.Tensor, cond_embedding_id: torch.Tensor) ->... class ResBlock1 (line 560) | class ResBlock1(nn.Module): method __init__ (line 576) | def __init__( method forward (line 682) | def forward(self, x: torch.Tensor) -> torch.Tensor: method remove_weight_norm (line 693) | def remove_weight_norm(self): method get_padding (line 700) | def get_padding(kernel_size: int, dilation: int = 1) -> int: class Backbone (line 704) | class Backbone(nn.Module): method forward (line 707) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class VocosBackbone (line 720) | class VocosBackbone(Backbone): method __init__ (line 734) | def __init__( method _init_weights (line 766) | def _init_weights(self, m): method forward (line 771) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class VocosResNetBackbone (line 786) | class VocosResNetBackbone(Backbone): method __init__ (line 797) | def __init__( method forward (line 817) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class Vocos (line 824) | class Vocos(nn.Module): method __init__ (line 825) | def __init__( method forward (line 877) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/codec_dataset.py class CodecDataset (line 15) | class CodecDataset(torch.utils.data.Dataset): method __init__ (line 16) | def __init__(self, cfg, dataset, is_valid=False): method __getitem__ (line 149) | def __getitem__(self, index): method get_metadata (line 186) | def get_metadata(self): method get_dataset_name (line 192) | def get_dataset_name(self): method __len__ (line 195) | def __len__(self): class CodecConcatDataset (line 199) | class CodecConcatDataset(ConcatDataset): method __init__ (line 200) | def __init__(self, datasets: Iterable[Dataset], full_audio_inference=F... class CodecCollator (line 229) | class CodecCollator(object): method __init__ (line 232) | def __init__(self, cfg): method __call__ (line 235) | def __call__(self, batch): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/codec_inference.py class VocoderInference (line 78) | class VocoderInference(object): method __init__ (line 79) | def __init__(self, args=None, cfg=None, infer_type="from_dataset"): method _build_tmp_dataset_from_feature (line 175) | def _build_tmp_dataset_from_feature(self): method _build_tmp_dataset_from_audio (line 210) | def _build_tmp_dataset_from_audio(self): method _build_test_dataset (line 241) | def _build_test_dataset(self): method _build_model (line 244) | def _build_model(self): method _build_dataloader (line 248) | def _build_dataloader(self): method _load_model (line 270) | def _load_model(self, checkpoint_dir, from_multi_gpu=False): method inference (line 334) | def inference(self): method _set_random_seed (line 376) | def _set_random_seed(self, seed): method _count_parameters (line 382) | def _count_parameters(self, model): method _dump_cfg (line 385) | def _dump_cfg(self, path): function load_nnvocoder (line 397) | def load_nnvocoder( function tensorize (line 460) | def tensorize(data, device, n_samples): function synthesis (line 471) | def synthesis( FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/codec_sampler.py class ScheduledSampler (line 18) | class ScheduledSampler(Sampler): method __init__ (line 33) | def __init__( method __len__ (line 77) | def __len__(self): method __iter__ (line 87) | def __iter__(self): function build_samplers (line 113) | def build_samplers(concat_dataset: Dataset, cfg, logger, type): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/codec_trainer.py class CodecTrainer (line 22) | class CodecTrainer: method __init__ (line 23) | def __init__(self): method _init_accelerator (line 26) | def _init_accelerator(self): method _build_dataset (line 45) | def _build_dataset(self): method _build_criterion (line 48) | def _build_criterion(self): method _build_model (line 51) | def _build_model(self): method _build_dataloader (line 54) | def _build_dataloader(self): method _build_optimizer (line 79) | def _build_optimizer(self): method _build_scheduler (line 82) | def _build_scheduler(self): method _load_model (line 85) | def _load_model(self, checkpoint_dir, checkpoint_path=None, resume_typ... method train_loop (line 109) | def train_loop(self): method _train_epoch (line 112) | def _train_epoch(self): method _valid_epoch (line 115) | def _valid_epoch(self): method _train_step (line 118) | def _train_step(self): method _valid_step (line 121) | def _valid_step(self): method _inference (line 124) | def _inference(self): method _set_random_seed (line 127) | def _set_random_seed(self, seed): method _check_nan (line 133) | def _check_nan(self, loss): method _check_basic_configs (line 138) | def _check_basic_configs(self): method _count_parameters (line 149) | def _count_parameters(self): method _dump_cfg (line 152) | def _dump_cfg(self, path): method _is_valid_pattern (line 163) | def _is_valid_pattern(self, directory_name): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/alias_free_torch/act.py class Activation1d (line 7) | class Activation1d(nn.Module): method __init__ (line 8) | def __init__( method forward (line 24) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/alias_free_torch/filter.py function sinc (line 13) | def sinc(x: torch.Tensor): function kaiser_sinc_filter1d (line 27) | def kaiser_sinc_filter1d( class LowPassFilter1d (line 61) | class LowPassFilter1d(nn.Module): method __init__ (line 62) | def __init__( method forward (line 89) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/alias_free_torch/resample.py class UpSample1d (line 9) | class UpSample1d(nn.Module): method __init__ (line 10) | def __init__(self, ratio=2, kernel_size=None): method forward (line 28) | def forward(self, x): class DownSample1d (line 40) | class DownSample1d(nn.Module): method __init__ (line 41) | def __init__(self, ratio=2, kernel_size=None): method forward (line 54) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/facodec_dataset.py class FAcodecDataset (line 20) | class FAcodecDataset(torch.utils.data.Dataset): method __init__ (line 21) | def __init__(self, cfg, dataset, is_valid=False): method preprocess (line 45) | def preprocess(self, wave): method __len__ (line 53) | def __len__(self): method __getitem__ (line 57) | def __getitem__(self, index): class FAcodecCollator (line 66) | class FAcodecCollator(object): method __init__ (line 69) | def __init__(self, cfg): method __call__ (line 72) | def __call__(self, batch): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/facodec_inference.py class FAcodecInference (line 23) | class FAcodecInference(object): method __init__ (line 24) | def __init__(self, args=None, cfg=None): method _build_model (line 31) | def _build_model(self): method _load_checkpoint (line 36) | def _load_checkpoint(self): method inference (line 53) | def inference(self, source, output_dir): method voice_conversion (line 90) | def voice_conversion(self, source, reference, output_dir): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/facodec_trainer.py class FAcodecTrainer (line 59) | class FAcodecTrainer(CodecTrainer): method __init__ (line 60) | def __init__(self, args, cfg): method _build_dataset (line 211) | def _build_dataset(self): method _build_criterion (line 214) | def _build_criterion(self): method _build_model (line 235) | def _build_model(self): method _built_helper_model (line 240) | def _built_helper_model(self): method _build_optimizer (line 264) | def _build_optimizer(self): method train_loop (line 277) | def train_loop(self): method _train_epoch (line 372) | def _train_epoch(self): method _train_step (line 438) | def _train_step(self, data): method _inference (line 716) | def _inference(self, eval_wave): method _load_model (line 727) | def _load_model(self, checkpoint_path=None, resume_type="resume"): method _count_parameters (line 771) | def _count_parameters(self): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/JDC/model.py class JDCNet (line 18) | class JDCNet(nn.Module): method __init__ (line 23) | def __init__(self, num_class=722, seq_len=31, leaky_relu_slope=0.01): method get_feature_GAN (line 93) | def get_feature_GAN(self, x): method get_feature (line 107) | def get_feature(self, x): method forward (line 121) | def forward(self, x): method init_weights (line 164) | def init_weights(m): class ResBlock (line 182) | class ResBlock(nn.Module): method __init__ (line 183) | def __init__(self, in_channels: int, out_channels: int, leaky_relu_slo... method forward (line 213) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/attentions.py class LayerNorm (line 18) | class LayerNorm(nn.Module): method __init__ (line 19) | def __init__(self, channels, eps=1e-5): method forward (line 27) | def forward(self, x): class Encoder (line 33) | class Encoder(nn.Module): method __init__ (line 34) | def __init__( method forward (line 81) | def forward(self, x, x_mask): class Decoder (line 96) | class Decoder(nn.Module): method __init__ (line 97) | def __init__( method forward (line 156) | def forward(self, x, x_mask, h, h_mask): class MultiHeadAttention (line 182) | class MultiHeadAttention(nn.Module): method __init__ (line 183) | def __init__( method forward (line 236) | def forward(self, x, c, attn_mask=None): method attention (line 246) | def attention(self, query, key, value, mask=None): method _matmul_with_relative_values (line 297) | def _matmul_with_relative_values(self, x, y): method _matmul_with_relative_keys (line 306) | def _matmul_with_relative_keys(self, x, y): method _get_relative_embeddings (line 315) | def _get_relative_embeddings(self, relative_embeddings, length): method _relative_position_to_absolute_position (line 333) | def _relative_position_to_absolute_position(self, x): method _absolute_position_to_relative_position (line 354) | def _absolute_position_to_relative_position(self, x): method _attention_bias_proximal (line 370) | def _attention_bias_proximal(self, length): class FFN (line 382) | class FFN(nn.Module): method __init__ (line 383) | def __init__( method forward (line 411) | def forward(self, x, x_mask): method _causal_padding (line 421) | def _causal_padding(self, x): method _same_padding (line 430) | def _same_padding(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/commons.py class AttrDict (line 18) | class AttrDict(dict): method __init__ (line 19) | def __init__(self, *args, **kwargs): function init_weights (line 24) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 30) | def get_padding(kernel_size, dilation=1): function convert_pad_shape (line 34) | def convert_pad_shape(pad_shape): function intersperse (line 40) | def intersperse(lst, item): function kl_divergence (line 46) | def kl_divergence(m_p, logs_p, m_q, logs_q): function rand_gumbel (line 55) | def rand_gumbel(shape): function rand_gumbel_like (line 61) | def rand_gumbel_like(x): function slice_segments (line 66) | def slice_segments(x, ids_str, segment_size=4): function slice_segments_audio (line 75) | def slice_segments_audio(x, ids_str, segment_size=4): function rand_slice_segments (line 84) | def rand_slice_segments(x, x_lengths=None, segment_size=4): function get_timing_signal_1d (line 96) | def get_timing_signal_1d(length, channels, min_timescale=1.0, max_timesc... function add_timing_signal_1d (line 112) | def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4): function cat_timing_signal_1d (line 118) | def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis... function subsequent_mask (line 124) | def subsequent_mask(length): function fused_add_tanh_sigmoid_multiply (line 130) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): function convert_pad_shape (line 139) | def convert_pad_shape(pad_shape): function shift_1d (line 145) | def shift_1d(x): function sequence_mask (line 150) | def sequence_mask(length, max_length=None): function generate_path (line 157) | def generate_path(duration, mask): function clip_grad_value_ (line 175) | def clip_grad_value_(parameters, clip_value, norm_type=2): function log_norm (line 193) | def log_norm(x, mean=-4, std=4, dim=2): function load_F0_models (line 204) | def load_F0_models(path): function build_model (line 226) | def build_model(args): function load_checkpoint (line 290) | def load_checkpoint( function recursive_munch (line 325) | def recursive_munch(d): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/gradient_reversal.py class GradientReversal (line 11) | class GradientReversal(Function): method forward (line 13) | def forward(ctx, x, alpha): method backward (line 18) | def backward(ctx, grad_output): method __init__ (line 30) | def __init__(self, alpha): method forward (line 34) | def forward(self, x): class GradientReversal (line 29) | class GradientReversal(nn.Module): method forward (line 13) | def forward(ctx, x, alpha): method backward (line 18) | def backward(ctx, grad_output): method __init__ (line 30) | def __init__(self, alpha): method forward (line 34) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/layers.py function _get_activation_fn (line 20) | def _get_activation_fn(activ): class LinearNorm (line 33) | class LinearNorm(torch.nn.Module): method __init__ (line 34) | def __init__(self, in_dim, out_dim, bias=True, w_init_gain="linear"): method forward (line 42) | def forward(self, x): class ConvNorm (line 46) | class ConvNorm(torch.nn.Module): method __init__ (line 47) | def __init__( method forward (line 79) | def forward(self, signal): class CausualConv (line 84) | class CausualConv(nn.Module): method __init__ (line 85) | def __init__( method forward (line 118) | def forward(self, x): class CausualBlock (line 124) | class CausualBlock(nn.Module): method __init__ (line 125) | def __init__(self, hidden_dim, n_conv=3, dropout_p=0.2, activ="lrelu"): method forward (line 136) | def forward(self, x): method _get_conv (line 143) | def _get_conv(self, hidden_dim, dilation, activ="lrelu", dropout_p=0.2): class ConvBlock (line 162) | class ConvBlock(nn.Module): method __init__ (line 163) | def __init__(self, hidden_dim, n_conv=3, dropout_p=0.2, activ="relu"): method forward (line 175) | def forward(self, x): method _get_conv (line 182) | def _get_conv(self, hidden_dim, dilation, activ="relu", dropout_p=0.2): class LocationLayer (line 201) | class LocationLayer(nn.Module): method __init__ (line 202) | def __init__(self, attention_n_filters, attention_kernel_size, attenti... method forward (line 218) | def forward(self, attention_weights_cat): class Attention (line 225) | class Attention(nn.Module): method __init__ (line 226) | def __init__( method get_alignment_energies (line 247) | def get_alignment_energies(self, query, processed_memory, attention_we... method forward (line 268) | def forward( class ForwardAttentionV2 (line 299) | class ForwardAttentionV2(nn.Module): method __init__ (line 300) | def __init__( method get_alignment_energies (line 321) | def get_alignment_energies(self, query, processed_memory, attention_we... method forward (line 342) | def forward( class PhaseShuffle2d (line 397) | class PhaseShuffle2d(nn.Module): method __init__ (line 398) | def __init__(self, n=2): method forward (line 403) | def forward(self, x, move=None): class PhaseShuffle1d (line 417) | class PhaseShuffle1d(nn.Module): method __init__ (line 418) | def __init__(self, n=2): method forward (line 423) | def forward(self, x, move=None): class MFCC (line 438) | class MFCC(nn.Module): method __init__ (line 439) | def __init__(self, n_mfcc=40, n_mels=80): method forward (line 447) | def forward(self, mel_specgram): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/quantize.py function init_weights (line 22) | def init_weights(m): function WNConv1d (line 28) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 32) | def WNConvTranspose1d(*args, **kwargs): class SnakeBeta (line 36) | class SnakeBeta(nn.Module): method __init__ (line 54) | def __init__( method forward (line 84) | def forward(self, x): class ResidualUnit (line 100) | class ResidualUnit(nn.Module): method __init__ (line 101) | def __init__(self, dim: int = 16, dilation: int = 1): method forward (line 111) | def forward(self, x): class CNNLSTM (line 115) | class CNNLSTM(nn.Module): method __init__ (line 116) | def __init__(self, indim, outdim, head, global_pred=False): method forward (line 128) | def forward(self, x): function sequence_mask (line 137) | def sequence_mask(length, max_length=None): class MFCC (line 144) | class MFCC(nn.Module): method __init__ (line 145) | def __init__(self, n_mfcc=40, n_mels=80): method forward (line 153) | def forward(self, mel_specgram): class FAquantizer (line 169) | class FAquantizer(nn.Module): method __init__ (line 170) | def __init__( method preprocess (line 269) | def preprocess(self, wave_tensor, n_bins=20): method decode (line 275) | def decode(self, codes): method encode (line 287) | def encode(self, x, wave_segments, n_c=1): method forward (line 357) | def forward( method forward_v2 (line 460) | def forward_v2( method voice_conversion (line 571) | def voice_conversion(self, z, ref_wave): class FApredictors (line 590) | class FApredictors(nn.Module): method __init__ (line 591) | def __init__( method forward (line 643) | def forward(self, quantized): method forward_v2 (line 699) | def forward_v2(self, quantized, timbre): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/style_encoder.py class Mish (line 14) | class Mish(nn.Module): method __init__ (line 15) | def __init__(self): method forward (line 18) | def forward(self, x): class Conv1dGLU (line 22) | class Conv1dGLU(nn.Module): method __init__ (line 28) | def __init__(self, in_channels, out_channels, kernel_size, dropout): method forward (line 36) | def forward(self, x): class StyleEncoder (line 45) | class StyleEncoder(torch.nn.Module): method __init__ (line 46) | def __init__(self, in_dim=513, hidden_dim=128, out_dim=256): method forward (line 82) | def forward(self, x, mask=None): method temporal_avg_pool (line 102) | def temporal_avg_pool(self, x, mask=None): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/modules/wavenet.py class LayerNorm (line 20) | class LayerNorm(nn.Module): method __init__ (line 21) | def __init__(self, channels, eps=1e-5): method forward (line 29) | def forward(self, x): class ConvReluNorm (line 35) | class ConvReluNorm(nn.Module): method __init__ (line 36) | def __init__( method forward (line 77) | def forward(self, x, x_mask): class DDSConv (line 87) | class DDSConv(nn.Module): method __init__ (line 92) | def __init__(self, channels, kernel_size, n_layers, p_dropout=0.0): method forward (line 121) | def forward(self, x, x_mask, g=None): class WN (line 136) | class WN(torch.nn.Module): method __init__ (line 137) | def __init__( method forward (line 191) | def forward(self, x, x_mask, g=None, **kwargs): method remove_weight_norm (line 218) | def remove_weight_norm(self): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/facodec/optimizer.py class MultiOptimizer (line 16) | class MultiOptimizer: method __init__ (line 17) | def __init__(self, optimizers={}, schedulers={}): method state_dict (line 25) | def state_dict(self): method scheduler_state_dict (line 29) | def scheduler_state_dict(self): method load_state_dict (line 33) | def load_state_dict(self, state_dict): method load_scheduler_state_dict (line 40) | def load_scheduler_state_dict(self, state_dict): method step (line 47) | def step(self, key=None, scaler=None): method _step (line 51) | def _step(self, key, scaler=None): method zero_grad (line 58) | def zero_grad(self, key=None): method scheduler (line 64) | def scheduler(self, *args, key=None): function define_scheduler (line 71) | def define_scheduler(optimizer, params): function build_optimizer (line 77) | def build_optimizer(model_dict, scheduler_params_dict, lr, type="AdamW"): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/kmeans/repcodec_model.py function init_weights (line 18) | def init_weights(m): function compute_codebook_perplexity (line 27) | def compute_codebook_perplexity(indices, codebook_size): class RepCodec (line 34) | class RepCodec(nn.Module): method __init__ (line 35) | def __init__( method forward (line 141) | def forward(self, x): method quantize (line 176) | def quantize(self, x): method reset_parameters (line 198) | def reset_parameters(self): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/kmeans/vocos.py function safe_log (line 17) | def safe_log(x: torch.Tensor, clip_val: float = 1e-7) -> torch.Tensor: function symlog (line 31) | def symlog(x: torch.Tensor) -> torch.Tensor: function symexp (line 35) | def symexp(x: torch.Tensor) -> torch.Tensor: class STFT (line 39) | class STFT(nn.Module): method __init__ (line 40) | def __init__( method forward (line 55) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ISTFT (line 83) | class ISTFT(nn.Module): method __init__ (line 98) | def __init__( method forward (line 111) | def forward(self, spec: torch.Tensor) -> torch.Tensor: class MDCT (line 169) | class MDCT(nn.Module): method __init__ (line 178) | def __init__(self, frame_len: int, padding: str = "same"): method forward (line 196) | def forward(self, audio: torch.Tensor) -> torch.Tensor: class IMDCT (line 230) | class IMDCT(nn.Module): method __init__ (line 239) | def __init__(self, frame_len: int, padding: str = "same"): method forward (line 255) | def forward(self, X: torch.Tensor) -> torch.Tensor: class FourierHead (line 298) | class FourierHead(nn.Module): method forward (line 301) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ISTFTHead (line 313) | class ISTFTHead(FourierHead): method __init__ (line 325) | def __init__(self, dim: int, n_fft: int, hop_length: int, padding: str... method forward (line 333) | def forward(self, x: torch.Tensor) -> torch.Tensor: class IMDCTSymExpHead (line 363) | class IMDCTSymExpHead(FourierHead): method __init__ (line 376) | def __init__( method forward (line 400) | def forward(self, x: torch.Tensor) -> torch.Tensor: class IMDCTCosHead (line 423) | class IMDCTCosHead(FourierHead): method __init__ (line 434) | def __init__( method forward (line 446) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ConvNeXtBlock (line 468) | class ConvNeXtBlock(nn.Module): method __init__ (line 480) | def __init__( method forward (line 507) | def forward( class AdaLayerNorm (line 529) | class AdaLayerNorm(nn.Module): method __init__ (line 538) | def __init__(self, num_embeddings: int, embedding_dim: int, eps: float... method forward (line 551) | def forward(self, x: torch.Tensor, cond_embedding_id: torch.Tensor) ->... class ResBlock1 (line 559) | class ResBlock1(nn.Module): method __init__ (line 575) | def __init__( method forward (line 681) | def forward(self, x: torch.Tensor) -> torch.Tensor: method remove_weight_norm (line 692) | def remove_weight_norm(self): method get_padding (line 699) | def get_padding(kernel_size: int, dilation: int = 1) -> int: class Backbone (line 703) | class Backbone(nn.Module): method forward (line 706) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class VocosBackbone (line 719) | class VocosBackbone(Backbone): method __init__ (line 733) | def __init__( method _init_weights (line 765) | def _init_weights(self, m): method forward (line 770) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class VocosResNetBackbone (line 785) | class VocosResNetBackbone(Backbone): method __init__ (line 796) | def __init__( method forward (line 816) | def forward(self, x: torch.Tensor, **kwargs) -> torch.Tensor: class Vocos (line 823) | class Vocos(nn.Module): method __init__ (line 824) | def __init__( method forward (line 846) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/melvqgan/melspec.py function dynamic_range_compression (line 19) | def dynamic_range_compression(x, C=1, clip_val=1e-5): function dynamic_range_decompression (line 23) | def dynamic_range_decompression(x, C=1): function dynamic_range_compression_torch (line 27) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 31) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 35) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 40) | def spectral_de_normalize_torch(magnitudes): class MelSpectrogram (line 45) | class MelSpectrogram(nn.Module): method __init__ (line 46) | def __init__( method forward (line 79) | def forward(self, y): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/alias_free_torch/act.py class Activation1d (line 7) | class Activation1d(nn.Module): method __init__ (line 8) | def __init__( method forward (line 24) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/alias_free_torch/filter.py function sinc (line 13) | def sinc(x: torch.Tensor): function kaiser_sinc_filter1d (line 27) | def kaiser_sinc_filter1d( class LowPassFilter1d (line 61) | class LowPassFilter1d(nn.Module): method __init__ (line 62) | def __init__( method forward (line 89) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/alias_free_torch/resample.py class UpSample1d (line 9) | class UpSample1d(nn.Module): method __init__ (line 10) | def __init__(self, ratio=2, kernel_size=None): method forward (line 28) | def forward(self, x): class DownSample1d (line 40) | class DownSample1d(nn.Module): method __init__ (line 41) | def __init__(self, ratio=2, kernel_size=None): method forward (line 54) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/facodec.py function init_weights (line 21) | def init_weights(m): function WNConv1d (line 27) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 31) | def WNConvTranspose1d(*args, **kwargs): class CNNLSTM (line 35) | class CNNLSTM(nn.Module): method __init__ (line 36) | def __init__(self, indim, outdim, head, global_pred=False): method forward (line 48) | def forward(self, x): class SnakeBeta (line 57) | class SnakeBeta(nn.Module): method __init__ (line 75) | def __init__( method forward (line 105) | def forward(self, x): class ResidualUnit (line 121) | class ResidualUnit(nn.Module): method __init__ (line 122) | def __init__(self, dim: int = 16, dilation: int = 1): method forward (line 132) | def forward(self, x): class EncoderBlock (line 136) | class EncoderBlock(nn.Module): method __init__ (line 137) | def __init__(self, dim: int = 16, stride: int = 1): method forward (line 153) | def forward(self, x): class FACodecEncoder (line 157) | class FACodecEncoder(nn.Module): method __init__ (line 158) | def __init__( method forward (line 189) | def forward(self, x): method inference (line 193) | def inference(self, x): method remove_weight_norm (line 196) | def remove_weight_norm(self): method apply_weight_norm (line 207) | def apply_weight_norm(self): method reset_parameters (line 216) | def reset_parameters(self): class DecoderBlock (line 220) | class DecoderBlock(nn.Module): method __init__ (line 221) | def __init__(self, input_dim: int = 16, output_dim: int = 8, stride: i... method forward (line 238) | def forward(self, x): class FACodecDecoder (line 242) | class FACodecDecoder(nn.Module): method __init__ (line 243) | def __init__( method quantize (line 408) | def quantize(self, x, n_quantizers=None): method forward (line 447) | def forward( method vq2emb (line 556) | def vq2emb(self, vq, use_residual_code=True): method inference (line 568) | def inference(self, x, speaker_embedding): method remove_weight_norm (line 578) | def remove_weight_norm(self): method apply_weight_norm (line 589) | def apply_weight_norm(self): method reset_parameters (line 598) | def reset_parameters(self): class FACodecRedecoder (line 602) | class FACodecRedecoder(nn.Module): method __init__ (line 603) | def __init__( method forward (line 691) | def forward( method vq2emb (line 734) | def vq2emb(self, vq, speaker_embedding, use_residual=True): method inference (line 761) | def inference(self, x, speaker_embedding): class FACodecEncoderV2 (line 772) | class FACodecEncoderV2(nn.Module): method __init__ (line 773) | def __init__( method forward (line 814) | def forward(self, x): method inference (line 818) | def inference(self, x): method get_prosody_feature (line 821) | def get_prosody_feature(self, x): method remove_weight_norm (line 824) | def remove_weight_norm(self): method apply_weight_norm (line 835) | def apply_weight_norm(self): method reset_parameters (line 844) | def reset_parameters(self): class FACodecDecoderV2 (line 848) | class FACodecDecoderV2(nn.Module): method __init__ (line 849) | def __init__( method quantize (line 1027) | def quantize(self, x, prosody_feature, n_quantizers=None): method forward (line 1069) | def forward( method vq2emb (line 1179) | def vq2emb(self, vq, use_residual=True): method inference (line 1191) | def inference(self, x, speaker_embedding): method remove_weight_norm (line 1201) | def remove_weight_norm(self): method apply_weight_norm (line 1212) | def apply_weight_norm(self): method reset_parameters (line 1221) | def reset_parameters(self): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/gradient_reversal.py class GradientReversal (line 11) | class GradientReversal(Function): method forward (line 13) | def forward(ctx, x, alpha): method backward (line 18) | def backward(ctx, grad_output): method __init__ (line 30) | def __init__(self, alpha): method forward (line 34) | def forward(self, x): class GradientReversal (line 29) | class GradientReversal(nn.Module): method forward (line 13) | def forward(ctx, x, alpha): method backward (line 18) | def backward(ctx, grad_output): method __init__ (line 30) | def __init__(self, alpha): method forward (line 34) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/melspec.py function dynamic_range_compression (line 13) | def dynamic_range_compression(x, C=1, clip_val=1e-5): function dynamic_range_decompression (line 17) | def dynamic_range_decompression(x, C=1): function dynamic_range_compression_torch (line 21) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 25) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 29) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 34) | def spectral_de_normalize_torch(magnitudes): class MelSpectrogram (line 39) | class MelSpectrogram(nn.Module): method __init__ (line 40) | def __init__( method forward (line 73) | def forward(self, y): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/quantize/fvq.py class FactorizedVectorQuantize (line 16) | class FactorizedVectorQuantize(nn.Module): method __init__ (line 17) | def __init__(self, dim, codebook_size, codebook_dim, commitment, **kwa... method codebook (line 32) | def codebook(self): method forward (line 35) | def forward(self, z): method vq2emb (line 86) | def vq2emb(self, vq, proj=True): method get_emb (line 92) | def get_emb(self): method embed_code (line 95) | def embed_code(self, embed_id): method decode_code (line 98) | def decode_code(self, embed_id): method decode_latents (line 101) | def decode_latents(self, latents): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/quantize/rvq.py class ResidualVQ (line 12) | class ResidualVQ(nn.Module): method __init__ (line 15) | def __init__(self, *, num_quantizers, codebook_size, **kwargs): method forward (line 27) | def forward(self, x, n_quantizers=None): method vq2emb (line 75) | def vq2emb(self, vq): method get_emb (line 83) | def get_emb(self): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/ns3_codec/transformer.py class StyleAdaptiveLayerNorm (line 13) | class StyleAdaptiveLayerNorm(nn.Module): method __init__ (line 14) | def __init__(self, normalized_shape, eps=1e-5): method forward (line 22) | def forward(self, x, condition): class PositionalEncoding (line 35) | class PositionalEncoding(nn.Module): method __init__ (line 36) | def __init__(self, d_model, dropout, max_len=5000): method forward (line 49) | def forward(self, x): class TransformerFFNLayer (line 54) | class TransformerFFNLayer(nn.Module): method __init__ (line 55) | def __init__( method forward (line 75) | def forward(self, x): class TransformerEncoderLayer (line 86) | class TransformerEncoderLayer(nn.Module): method __init__ (line 87) | def __init__( method forward (line 122) | def forward(self, x, key_padding_mask, conditon=None): class TransformerEncoder (line 154) | class TransformerEncoder(nn.Module): method __init__ (line 155) | def __init__( method forward (line 219) | def forward(self, x, key_padding_mask, condition=None): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/model.py class SpeechTokenizer (line 14) | class SpeechTokenizer(nn.Module): method __init__ (line 15) | def __init__(self, config): method load_from_checkpoint (line 63) | def load_from_checkpoint(cls, config_path: str, ckpt_path: str): method forward (line 88) | def forward(self, x: torch.tensor, n_q: int = None, layers: list = [0]): method forward_feature (line 120) | def forward_feature(self, x: torch.tensor, layers: list = None): method encode (line 141) | def encode(self, x: torch.tensor, n_q: int = None, st: int = None): method decode (line 166) | def decode(self, codes: torch.tensor, st: int = 0): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/conv.py function apply_parametrization_norm (line 39) | def apply_parametrization_norm(module: nn.Module, norm: str = "none") ->... function get_norm_module (line 51) | def get_norm_module( function get_extra_padding_for_conv1d (line 70) | def get_extra_padding_for_conv1d( function pad_for_conv1d (line 80) | def pad_for_conv1d( function pad1d (line 97) | def pad1d( function unpad1d (line 122) | def unpad1d(x: torch.Tensor, paddings: tp.Tuple[int, int]): class NormConv1d (line 131) | class NormConv1d(nn.Module): method __init__ (line 136) | def __init__( method forward (line 149) | def forward(self, x): class NormConv2d (line 155) | class NormConv2d(nn.Module): method __init__ (line 160) | def __init__( method forward (line 172) | def forward(self, x): class NormConvTranspose1d (line 178) | class NormConvTranspose1d(nn.Module): method __init__ (line 183) | def __init__( method forward (line 198) | def forward(self, x): class NormConvTranspose2d (line 204) | class NormConvTranspose2d(nn.Module): method __init__ (line 209) | def __init__( method forward (line 222) | def forward(self, x): class SConv1d (line 228) | class SConv1d(nn.Module): method __init__ (line 233) | def __init__( method forward (line 269) | def forward(self, x): class SConvTranspose1d (line 291) | class SConvTranspose1d(nn.Module): method __init__ (line 296) | def __init__( method forward (line 324) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/lstm.py class SLSTM (line 18) | class SLSTM(nn.Module): method __init__ (line 24) | def __init__( method forward (line 38) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/norm.py class ConvLayerNorm (line 22) | class ConvLayerNorm(nn.LayerNorm): method __init__ (line 28) | def __init__( method forward (line 33) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/quantization/ac.py function build_stable_quantized_cdf (line 24) | def build_stable_quantized_cdf( class ArithmeticCoder (line 68) | class ArithmeticCoder: method __init__ (line 108) | def __init__(self, fo: tp.IO[bytes], total_range_bits: int = 24): method delta (line 119) | def delta(self) -> int: method _flush_common_prefix (line 123) | def _flush_common_prefix(self): method push (line 142) | def push(self, symbol: int, quantized_cdf: torch.Tensor): method flush (line 181) | def flush(self): class ArithmeticDecoder (line 190) | class ArithmeticDecoder: method __init__ (line 206) | def __init__(self, fo: tp.IO[bytes], total_range_bits: int = 24): method delta (line 219) | def delta(self) -> int: method _flush_common_prefix (line 222) | def _flush_common_prefix(self): method pull (line 238) | def pull(self, quantized_cdf: torch.Tensor) -> tp.Optional[int]: function test (line 288) | def test(): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/quantization/core_vq.py function default (line 49) | def default(val: tp.Any, d: tp.Any) -> tp.Any: function ema_inplace (line 53) | def ema_inplace(moving_avg, new, decay: float): function laplace_smoothing (line 57) | def laplace_smoothing(x, n_categories: int, epsilon: float = 1e-5): function uniform_init (line 61) | def uniform_init(*shape: int): function sample_vectors (line 67) | def sample_vectors(samples, num: int): function kmeans (line 78) | def kmeans(samples, num_clusters: int, num_iters: int = 10): class EuclideanCodebook (line 101) | class EuclideanCodebook(nn.Module): method __init__ (line 117) | def __init__( method init_embed_ (line 146) | def init_embed_(self, data): method replace_ (line 158) | def replace_(self, samples, mask): method expire_codes_ (line 164) | def expire_codes_(self, batch_samples): method preprocess (line 176) | def preprocess(self, x): method quantize (line 180) | def quantize(self, x): method postprocess_emb (line 190) | def postprocess_emb(self, embed_ind, shape): method dequantize (line 193) | def dequantize(self, embed_ind): method encode (line 197) | def encode(self, x): method decode (line 207) | def decode(self, embed_ind): method forward (line 211) | def forward(self, x): class VectorQuantization (line 239) | class VectorQuantization(nn.Module): method __init__ (line 256) | def __init__( method codebook (line 294) | def codebook(self): method encode (line 297) | def encode(self, x): method decode (line 303) | def decode(self, embed_ind): method forward (line 309) | def forward(self, x): class ResidualVectorQuantization (line 331) | class ResidualVectorQuantization(nn.Module): method __init__ (line 336) | def __init__(self, *, num_quantizers, **kwargs): method forward (line 342) | def forward( method encode (line 367) | def encode( method decode (line 382) | def decode(self, q_indices: torch.Tensor, st: int = 0) -> torch.Tensor: FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/quantization/distrib.py function rank (line 20) | def rank(): function world_size (line 27) | def world_size(): function is_distributed (line 34) | def is_distributed(): function all_reduce (line 38) | def all_reduce(tensor: torch.Tensor, op=torch.distributed.ReduceOp.SUM): function _is_complex_or_float (line 43) | def _is_complex_or_float(tensor): function _check_number_of_params (line 47) | def _check_number_of_params(params: tp.List[torch.Tensor]): function broadcast_tensors (line 64) | def broadcast_tensors(tensors: tp.Iterable[torch.Tensor], src: int = 0): function sync_buffer (line 81) | def sync_buffer(buffers, average=True): function sync_grad (line 103) | def sync_grad(params): function average_metrics (line 123) | def average_metrics(metrics: tp.Dict[str, float], count=1.0): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/quantization/vq.py class QuantizedResult (line 26) | class QuantizedResult: class ResidualVectorQuantizer (line 34) | class ResidualVectorQuantizer(nn.Module): method __init__ (line 48) | def __init__( method forward (line 76) | def forward( method encode (line 102) | def encode( method decode (line 118) | def decode(self, codes: torch.Tensor, st: int = 0) -> torch.Tensor: FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/speechtokenizer/modules/seanet.py function snake (line 25) | def snake(x, alpha): class Snake1d (line 33) | class Snake1d(nn.Module): method __init__ (line 34) | def __init__(self, channels): method forward (line 38) | def forward(self, x): class SEANetResnetBlock (line 42) | class SEANetResnetBlock(nn.Module): method __init__ (line 58) | def __init__( method forward (line 110) | def forward(self, x): class SEANetEncoder (line 114) | class SEANetEncoder(nn.Module): method __init__ (line 140) | def __init__( method forward (line 249) | def forward(self, x): class SEANetDecoder (line 253) | class SEANetDecoder(nn.Module): method __init__ (line 281) | def __init__( method forward (line 394) | def forward(self, z): function test (line 399) | def test(): FILE: xinference/thirdparty/indextts/utils/maskgct/models/codec/vevo/vevo_repcodec.py class VectorQuantize (line 19) | class VectorQuantize(nn.Module): method __init__ (line 22) | def __init__( method codebook (line 46) | def codebook(self): method exists (line 49) | def exists(self, val): method default (line 52) | def default(self, val, d): method ema_inplace (line 55) | def ema_inplace(self, moving_avg, new, decay): method laplace_smoothing (line 58) | def laplace_smoothing(self, x, n_categories, eps=1e-5): method forward (line 61) | def forward(self, input): method forward_index (line 93) | def forward_index(self, input): class ResidualVQ (line 110) | class ResidualVQ(nn.Module): method __init__ (line 113) | def __init__(self, *, num_quantizers, **kwargs): method forward (line 119) | def forward(self, x): method forward_index (line 138) | def forward_index(self, x, flatten_idx=False): method initial (line 156) | def initial(self): method lookup (line 164) | def lookup(self, indices): class Quantizer (line 169) | class Quantizer(nn.Module): method __init__ (line 170) | def __init__( method initial (line 181) | def initial(self): method forward (line 184) | def forward(self, z): method inference (line 189) | def inference(self, z): method encode (line 194) | def encode(self, z): method decode (line 198) | def decode(self, indices): class Conv1d1x1 (line 203) | class Conv1d1x1(nn.Conv1d): method __init__ (line 206) | def __init__(self, in_channels, out_channels, bias=True): class Conv1d (line 212) | class Conv1d(nn.Module): method __init__ (line 213) | def __init__( method forward (line 242) | def forward(self, x): class ConvTranspose1d (line 253) | class ConvTranspose1d(nn.Module): method __init__ (line 254) | def __init__( method forward (line 281) | def forward(self, x): class ResidualUnit (line 292) | class ResidualUnit(nn.Module): method __init__ (line 293) | def __init__( method forward (line 317) | def forward(self, x): class Projector (line 323) | class Projector(nn.Module): method __init__ (line 324) | def __init__( method forward (line 332) | def forward(self, x): class EncoderBlock (line 336) | class EncoderBlock(nn.Module): method __init__ (line 337) | def __init__( method forward (line 369) | def forward(self, x): class Encoder (line 376) | class Encoder(nn.Module): method __init__ (line 377) | def __init__( method forward (line 416) | def forward(self, x): class DecoderBlock (line 423) | class DecoderBlock(nn.Module): method __init__ (line 426) | def __init__( method forward (line 466) | def forward(self, x): class Decoder (line 473) | class Decoder(nn.Module): method __init__ (line 474) | def __init__( method forward (line 518) | def forward(self, z): class VevoRepCodec (line 526) | class VevoRepCodec(nn.Module): method __init__ (line 527) | def __init__( method forward (line 587) | def forward(self, x): FILE: xinference/thirdparty/indextts/utils/maskgct/models/tts/maskgct/llama_nar.py class SinusoidalPosEmb (line 20) | class SinusoidalPosEmb(nn.Module): method __init__ (line 21) | def __init__(self, dim): method forward (line 25) | def forward(self, x): class LlamaAdaptiveRMSNorm (line 35) | class LlamaAdaptiveRMSNorm(nn.Module): method __init__ (line 36) | def __init__(self, hidden_size=1024, eps=1e-6, dim_cond=1024): method forward (line 44) | def forward(self, hidden_states, cond_embedding): class LlamaNARDecoderLayer (line 56) | class LlamaNARDecoderLayer(LlamaDecoderLayer): method __init__ (line 57) | def __init__(self, config: LlamaConfig, layer_idx: int): method forward (line 68) | def forward( method __init__ (line 129) | def __init__(self, config: LlamaConfig, layer_idx: int): method forward (line 140) | def forward( class DiffLlama (line 202) | class DiffLlama(LlamaModel): method __init__ (line 203) | def __init__( method _prepare_decoder_attention_mask (line 256) | def _prepare_decoder_attention_mask( method forward (line 295) | def forward( class DiffLlamaPrefix (line 427) | class DiffLlamaPrefix(LlamaModel): method __init__ (line 428) | def __init__( method _prepare_decoder_attention_mask (line 479) | def _prepare_decoder_attention_mask( method forward (line 518) | def forward( FILE: xinference/thirdparty/indextts/utils/maskgct/models/tts/maskgct/maskgct_s2a.py function top_k (line 14) | def top_k(logits, thres=0.9): function log (line 22) | def log(t, eps=1e-10): function gumbel_noise (line 26) | def gumbel_noise(t): function gumbel_sample (line 31) | def gumbel_sample(t, temperature=1.0, dim=-1): function top_k (line 35) | def top_k(logits, thres=0.9): function log (line 43) | def log(t, eps=1e-10): function gumbel_noise (line 47) | def gumbel_noise(t): function gumbel_sample (line 52) | def gumbel_sample(t, temperature=1.0, dim=-1): class MaskGCT_S2A (line 56) | class MaskGCT_S2A(nn.Module): method __init__ (line 57) | def __init__( method mask_prob (line 160) | def mask_prob(self, t): method mask_layer (line 163) | def mask_layer(self, t): method forward_diffusion (line 207) | def forward_diffusion(self, x0, t): method loss_t (line 270) | def loss_t(self, x0, x_mask, t, cond=None): method compute_loss (line 293) | def compute_loss(self, x0, x_mask, cond=None): method reset_parameters (line 300) | def reset_parameters(self): method reverse_diffusion (line 339) | def reverse_diffusion( method forward (line 492) | def forward(self, x0, x_mask, cond_code=None): FILE: xinference/thirdparty/indextts/utils/maskgct_utils.py function _load_config (line 18) | def _load_config(config_fn, lowercase=False): function load_config (line 42) | def load_config(config_fn, lowercase=False): class JsonHParams (line 58) | class JsonHParams: method __init__ (line 59) | def __init__(self, **kwargs): method keys (line 65) | def keys(self): method items (line 68) | def items(self): method values (line 71) | def values(self): method __len__ (line 74) | def __len__(self): method __getitem__ (line 77) | def __getitem__(self, key): method __setitem__ (line 80) | def __setitem__(self, key, value): method __contains__ (line 83) | def __contains__(self, key): method __repr__ (line 86) | def __repr__(self): function build_semantic_model (line 90) | def build_semantic_model( function build_semantic_codec (line 104) | def build_semantic_codec(cfg): function build_s2a_model (line 110) | def build_s2a_model(cfg, device): function build_acoustic_codec (line 117) | def build_acoustic_codec(cfg, device): class Inference_Pipeline (line 127) | class Inference_Pipeline: method __init__ (line 128) | def __init__( method get_emb (line 150) | def get_emb(self, input_features, attention_mask): method extract_acoustic_code (line 161) | def extract_acoustic_code(self, speech): method get_scode (line 168) | def get_scode(self, inputs): method semantic2acoustic (line 175) | def semantic2acoustic( method s2a_inference (line 224) | def s2a_inference( method gt_inference (line 248) | def gt_inference( FILE: xinference/thirdparty/indextts/utils/text_utils.py function contains_chinese (line 6) | def contains_chinese(text): function get_text_syllable_num (line 13) | def get_text_syllable_num(text): function get_text_tts_dur (line 31) | def get_text_tts_dur(text): FILE: xinference/thirdparty/indextts/utils/typical_sampling.py class TypicalLogitsWarper (line 4) | class TypicalLogitsWarper(BaseTypicalLogitsWarper): method __init__ (line 5) | def __init__(self, mass: float = 0.9, filter_value: float = -float("In... method __call__ (line 8) | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTen... FILE: xinference/thirdparty/indextts/utils/utils.py function load_audio (line 10) | def load_audio(audiopath, sampling_rate): function tokenize_by_CJK_char (line 28) | def tokenize_by_CJK_char(line: str) -> str: function make_pad_mask (line 53) | def make_pad_mask(lengths: torch.Tensor, max_len: int = 0) -> torch.Tensor: function safe_log (line 82) | def safe_log(x: torch.Tensor, clip_val: float = 1e-7) -> torch.Tensor: FILE: xinference/thirdparty/indextts/utils/webui_utils.py function html_center (line 4) | def html_center(text, label='p'): function html_left (line 10) | def html_left(text, label='p'): function next_page (line 16) | def next_page(page_number,sentences): function prev_page (line 27) | def prev_page(page_number): function update_current_texts (line 38) | def update_current_texts(page_number,sentences): FILE: xinference/thirdparty/indextts/utils/xtransformers.py function exists (line 27) | def exists(val): function default (line 31) | def default(val, d): function cast_tuple (line 37) | def cast_tuple(val, depth): class always (line 41) | class always(): method __init__ (line 42) | def __init__(self, val): method __call__ (line 45) | def __call__(self, *args, **kwargs): class not_equals (line 49) | class not_equals(): method __init__ (line 50) | def __init__(self, val): method __call__ (line 53) | def __call__(self, x, *args, **kwargs): class equals (line 57) | class equals(): method __init__ (line 58) | def __init__(self, val): method __call__ (line 61) | def __call__(self, x, *args, **kwargs): function max_neg_value (line 65) | def max_neg_value(tensor): function l2norm (line 69) | def l2norm(t): function init_zero_ (line 75) | def init_zero_(layer): function pick_and_pop (line 83) | def pick_and_pop(keys, d): function group_dict_by_key (line 88) | def group_dict_by_key(cond, d): function string_begins_with (line 97) | def string_begins_with(prefix, str): function group_by_key_prefix (line 101) | def group_by_key_prefix(prefix, d): function groupby_prefix_and_trim (line 105) | def groupby_prefix_and_trim(prefix, d): class ReluSquared (line 113) | class ReluSquared(nn.Module): method forward (line 114) | def forward(self, x): class AbsolutePositionalEmbedding (line 120) | class AbsolutePositionalEmbedding(nn.Module): method __init__ (line 121) | def __init__(self, dim, max_seq_len): method forward (line 126) | def forward(self, x): class FixedPositionalEmbedding (line 133) | class FixedPositionalEmbedding(nn.Module): method __init__ (line 134) | def __init__(self, dim): method forward (line 139) | def forward(self, x, seq_dim=1, offset=0): class RelativePositionBias (line 146) | class RelativePositionBias(nn.Module): method __init__ (line 147) | def __init__(self, scale, causal=False, num_buckets=32, max_distance=1... method _relative_position_bucket (line 156) | def _relative_position_bucket(relative_position, causal=True, num_buck... method forward (line 177) | def forward(self, qk_dots): class AlibiPositionalBias (line 189) | class AlibiPositionalBias(nn.Module): method __init__ (line 190) | def __init__(self, heads, **kwargs): method _get_slopes (line 199) | def _get_slopes(heads): method forward (line 212) | def forward(self, qk_dots): class LearnedAlibiPositionalBias (line 229) | class LearnedAlibiPositionalBias(AlibiPositionalBias): method __init__ (line 230) | def __init__(self, heads, bidirectional=False): method forward (line 239) | def forward(self, qk_dots): class RotaryEmbedding (line 264) | class RotaryEmbedding(nn.Module): method __init__ (line 265) | def __init__(self, dim): method forward (line 270) | def forward(self, max_seq_len, device): function rotate_half (line 277) | def rotate_half(x): function apply_rotary_pos_emb (line 283) | def apply_rotary_pos_emb(t, freqs): class Scale (line 291) | class Scale(nn.Module): method __init__ (line 292) | def __init__(self, value, fn): method forward (line 297) | def forward(self, x, **kwargs): class Rezero (line 307) | class Rezero(nn.Module): method __init__ (line 308) | def __init__(self, fn): method forward (line 313) | def forward(self, x, **kwargs): class ScaleNorm (line 323) | class ScaleNorm(nn.Module): method __init__ (line 324) | def __init__(self, dim, eps=1e-5): method forward (line 330) | def forward(self, x): class RMSNorm (line 335) | class RMSNorm(nn.Module): method __init__ (line 336) | def __init__(self, dim, eps=1e-8): method forward (line 342) | def forward(self, x): class RMSScaleShiftNorm (line 347) | class RMSScaleShiftNorm(nn.Module): method __init__ (line 348) | def __init__(self, dim, eps=1e-8): method forward (line 355) | def forward(self, x, norm_scale_shift_inp): class Residual (line 367) | class Residual(nn.Module): method __init__ (line 368) | def __init__(self, dim, scale_residual=False): method forward (line 372) | def forward(self, x, residual): class GRUGating (line 379) | class GRUGating(nn.Module): method __init__ (line 380) | def __init__(self, dim, scale_residual=False): method forward (line 385) | def forward(self, x, residual): function shift (line 399) | def shift(t, amount, mask=None): class ShiftTokens (line 409) | class ShiftTokens(nn.Module): method __init__ (line 410) | def __init__(self, shifts, fn): method forward (line 415) | def forward(self, x, **kwargs): class GLU (line 429) | class GLU(nn.Module): method __init__ (line 430) | def __init__(self, dim_in, dim_out, activation): method forward (line 435) | def forward(self, x): class FeedForward (line 440) | class FeedForward(nn.Module): method __init__ (line 441) | def __init__( method forward (line 473) | def forward(self, x): class Attention (line 479) | class Attention(nn.Module): method __init__ (line 480) | def __init__( method forward (line 576) | def forward( class AttentionLayers (line 731) | class AttentionLayers(nn.Module): method __init__ (line 732) | def __init__( method forward (line 906) | def forward( class Encoder (line 1016) | class Encoder(AttentionLayers): method __init__ (line 1017) | def __init__(self, **kwargs): class Decoder (line 1022) | class Decoder(AttentionLayers): method __init__ (line 1023) | def __init__(self, **kwargs): class CrossAttender (line 1028) | class CrossAttender(AttentionLayers): method __init__ (line 1029) | def __init__(self, **kwargs): class ViTransformerWrapper (line 1033) | class ViTransformerWrapper(nn.Module): method __init__ (line 1034) | def __init__( method forward (line 1062) | def forward( class TransformerWrapper (line 1087) | class TransformerWrapper(nn.Module): method __init__ (line 1088) | def __init__( method init_ (line 1131) | def init_(self): method forward (line 1134) | def forward( class ContinuousTransformerWrapper (line 1187) | class ContinuousTransformerWrapper(nn.Module): method __init__ (line 1188) | def __init__( method forward (line 1217) | def forward( FILE: xinference/thirdparty/indextts/vqvae/xtts_dvae.py function default (line 12) | def default(val, d): function eval_decorator (line 16) | def eval_decorator(fn): function dvae_wav_to_mel (line 27) | def dvae_wav_to_mel( class Quantize (line 51) | class Quantize(nn.Module): method __init__ (line 52) | def __init__(self, dim, n_embed, decay=0.99, eps=1e-5, balancing_heuri... method forward (line 71) | def forward(self, input, return_soft_codes=False): method embed_code (line 128) | def embed_code(self, embed_id): class DiscretizationLoss (line 135) | class DiscretizationLoss(nn.Module): method __init__ (line 136) | def __init__(self, discrete_bins, dim, expected_variance, store_past=0): method forward (line 149) | def forward(self, x): class ResBlock (line 171) | class ResBlock(nn.Module): method __init__ (line 172) | def __init__(self, chan, conv, activation): method forward (line 182) | def forward(self, x): class UpsampledConv (line 186) | class UpsampledConv(nn.Module): method __init__ (line 187) | def __init__(self, conv, *args, **kwargs): method forward (line 194) | def forward(self, x): class DiscreteVAE (line 201) | class DiscreteVAE(nn.Module): method __init__ (line 202) | def __init__( method norm (line 305) | def norm(self, images): method get_debug_values (line 316) | def get_debug_values(self, step, __): method get_codebook_indices (line 325) | def get_codebook_indices(self, images): method decode (line 332) | def decode(self, img_seq): method infer (line 353) | def infer(self, img): method forward (line 362) | def forward(self, img): method log_codes (line 384) | def log_codes(self, codes): FILE: xinference/thirdparty/internvl/conversation.py class SeparatorStyle (line 13) | class SeparatorStyle(IntEnum): class Conversation (line 37) | class Conversation: method get_prompt (line 61) | def get_prompt(self) -> str: method set_system_message (line 251) | def set_system_message(self, system_message: str): method append_message (line 255) | def append_message(self, role: str, message: str): method update_last_message (line 259) | def update_last_message(self, message: str): method to_gradio_chatbot (line 267) | def to_gradio_chatbot(self): method to_openai_api_messages (line 277) | def to_openai_api_messages(self): method copy (line 289) | def copy(self): method dict (line 304) | def dict(self): function register_conv_template (line 318) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 328) | def get_conv_template(name: str) -> Conversation: FILE: xinference/thirdparty/llava/conversation.py class SeparatorStyle (line 6) | class SeparatorStyle(Enum): class Conversation (line 13) | class Conversation: method get_prompt (line 27) | def get_prompt(self): method append_message (line 56) | def append_message(self, role, message): method get_images (line 59) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 118) | def to_gradio_chatbot(self): method copy (line 150) | def copy(self): method dict (line 162) | def dict(self): FILE: xinference/thirdparty/llava/mm_utils.py function load_image_from_base64 (line 12) | def load_image_from_base64(image): function process_images (line 16) | def process_images(images, image_processor, model_cfg): function expand2square (line 20) | def expand2square(pil_img, background_color): function tokenizer_image_token (line 34) | def tokenizer_image_token( function get_model_name_from_path (line 64) | def get_model_name_from_path(model_path): function load_pretrained_model (line 73) | def load_pretrained_model( class KeywordsStoppingCriteria (line 100) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 101) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 107) | def __call__( FILE: xinference/thirdparty/llava/model/clip_encoder/builder.py function build_vision_tower (line 4) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: xinference/thirdparty/llava/model/clip_encoder/clip_encoder.py class CLIPVisionTower (line 6) | class CLIPVisionTower(nn.Module): method __init__ (line 7) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 21) | def load_model(self): method feature_select (line 31) | def feature_select(self, image_forward_outs): method forward (line 42) | def forward(self, images): method dummy_feature (line 62) | def dummy_feature(self): method dtype (line 66) | def dtype(self): method device (line 70) | def device(self): method config (line 74) | def config(self): method hidden_size (line 81) | def hidden_size(self): method num_patches (line 85) | def num_patches(self): FILE: xinference/thirdparty/llava/model/llava_arch.py class LlavaMetaModel (line 26) | class LlavaMetaModel: method __init__ (line 27) | def __init__(self, config): method get_vision_tower (line 37) | def get_vision_tower(self): method initialize_vision_modules (line 43) | def initialize_vision_modules(self, model_args): class LlavaMetaForCausalLM (line 87) | class LlavaMetaForCausalLM(ABC): method get_model (line 89) | def get_model(self): method get_vision_tower (line 92) | def get_vision_tower(self): method encode_images (line 95) | def encode_images(self, images): method prepare_inputs_labels_for_multimodal (line 100) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 333) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: xinference/thirdparty/llava/model/llava_llama.py class LlavaConfig (line 27) | class LlavaConfig(LlamaConfig): class LlavaLlamaModel (line 31) | class LlavaLlamaModel(LlavaMetaModel, LlamaModel): method __init__ (line 34) | def __init__(self, config: LlamaConfig): class LlavaLlamaForCausalLM (line 39) | class LlavaLlamaForCausalLM(LlamaForCausalLM, LlavaMetaForCausalLM): method __init__ (line 42) | def __init__(self, config): method get_model (line 51) | def get_model(self): method forward (line 54) | def forward( method prepare_inputs_for_generation (line 137) | def prepare_inputs_for_generation( FILE: xinference/thirdparty/llava/model/multimodal_projector/builder.py class IdentityMap (line 6) | class IdentityMap(nn.Module): method __init__ (line 7) | def __init__(self): method forward (line 10) | def forward(self, x, *args, **kwargs): method config (line 14) | def config(self): class SimpleResBlock (line 18) | class SimpleResBlock(nn.Module): method __init__ (line 19) | def __init__(self, channels): method forward (line 27) | def forward(self, x): function build_vision_projector (line 32) | def build_vision_projector(config, delay_load=False, **kwargs): FILE: xinference/thirdparty/matcha/app.py function MATCHA_TTS_LOC (line 33) | def MATCHA_TTS_LOC(x): function VOCODER_LOC (line 37) | def VOCODER_LOC(x): function load_model (line 66) | def load_model(model_name, vocoder_name): function load_model_ui (line 72) | def load_model_ui(model_type, textbox): function process_text_gradio (line 102) | def process_text_gradio(text): function synthesise_mel (line 108) | def synthesise_mel(text, text_length, n_timesteps, temperature, length_s... function multispeaker_example_cacher (line 125) | def multispeaker_example_cacher(text, n_timesteps, mel_temp, length_scal... function ljspeech_example_cacher (line 137) | def ljspeech_example_cacher(text, n_timesteps, mel_temp, length_scale, s... function main (line 149) | def main(): FILE: xinference/thirdparty/matcha/cli.py function plot_spectrogram_to_numpy (line 37) | def plot_spectrogram_to_numpy(spectrogram, filename): function process_text (line 48) | def process_text(i: int, text: str, device: torch.device): function get_texts (line 62) | def get_texts(args): function assert_required_models_available (line 71) | def assert_required_models_available(args): function load_hifigan (line 84) | def load_hifigan(checkpoint_path, device): function load_vocoder (line 93) | def load_vocoder(vocoder_name, checkpoint_path, device): function load_matcha (line 108) | def load_matcha(model_name, checkpoint_path, device): function to_waveform (line 117) | def to_waveform(mel, vocoder, denoiser=None): function save_to_folder (line 125) | def save_to_folder(filename: str, output: dict, folder: str): function validate_args (line 134) | def validate_args(args): function validate_args_for_multispeaker_model (line 163) | def validate_args_for_multispeaker_model(args): function validate_args_for_single_speaker_model (line 188) | def validate_args_for_single_speaker_model(args): function cli (line 208) | def cli(): class BatchedSynthesisDataset (line 292) | class BatchedSynthesisDataset(torch.utils.data.Dataset): method __init__ (line 293) | def __init__(self, processed_texts): method __len__ (line 296) | def __len__(self): method __getitem__ (line 299) | def __getitem__(self, idx): function batched_collate_fn (line 303) | def batched_collate_fn(batch): function batched_synthesis (line 316) | def batched_synthesis(args, device, model, vocoder, denoiser, texts, spk): function unbatched_synthesis (line 359) | def unbatched_synthesis(args, device, model, vocoder, denoiser, texts, s... function print_config (line 398) | def print_config(args): function get_device (line 408) | def get_device(args): FILE: xinference/thirdparty/matcha/data/text_mel_datamodule.py function parse_filelist (line 17) | def parse_filelist(filelist_path, split_char="|"): class TextMelDataModule (line 23) | class TextMelDataModule(LightningDataModule): method __init__ (line 24) | def __init__( # pylint: disable=unused-argument method setup (line 52) | def setup(self, stage: Optional[str] = None): # pylint: disable=unuse... method train_dataloader (line 93) | def train_dataloader(self): method val_dataloader (line 103) | def val_dataloader(self): method teardown (line 113) | def teardown(self, stage: Optional[str] = None): method state_dict (line 117) | def state_dict(self): method load_state_dict (line 121) | def load_state_dict(self, state_dict: Dict[str, Any]): class TextMelDataset (line 126) | class TextMelDataset(torch.utils.data.Dataset): method __init__ (line 127) | def __init__( method get_datapoint (line 164) | def get_datapoint(self, filepath_and_text): method get_durations (line 182) | def get_durations(self, filepath, text): method get_mel (line 199) | def get_mel(self, filepath): method get_text (line 216) | def get_text(self, text, add_blank=True): method __getitem__ (line 223) | def __getitem__(self, index): method __len__ (line 227) | def __len__(self): class TextMelBatchCollate (line 231) | class TextMelBatchCollate: method __init__ (line 232) | def __init__(self, n_spks): method __call__ (line 235) | def __call__(self, batch): FILE: xinference/thirdparty/matcha/hifigan/denoiser.py class Denoiser (line 7) | class Denoiser(torch.nn.Module): method __init__ (line 10) | def __init__(self, vocoder, filter_length=1024, n_overlap=4, win_lengt... method forward (line 59) | def forward(self, audio, strength=0.0005): FILE: xinference/thirdparty/matcha/hifigan/env.py class AttrDict (line 7) | class AttrDict(dict): method __init__ (line 8) | def __init__(self, *args, **kwargs): function build_env (line 13) | def build_env(config, config_name, path): FILE: xinference/thirdparty/matcha/hifigan/meldataset.py function load_wav (line 17) | def load_wav(full_path): function dynamic_range_compression (line 22) | def dynamic_range_compression(x, C=1, clip_val=1e-5): function dynamic_range_decompression (line 26) | def dynamic_range_decompression(x, C=1): function dynamic_range_compression_torch (line 30) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 34) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 38) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 43) | def spectral_de_normalize_torch(magnitudes): function mel_spectrogram (line 52) | def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_siz... function get_dataset_filelist (line 92) | def get_dataset_filelist(a): class MelDataset (line 105) | class MelDataset(torch.utils.data.Dataset): method __init__ (line 106) | def __init__( method __getitem__ (line 146) | def __getitem__(self, index): method __len__ (line 216) | def __len__(self): FILE: xinference/thirdparty/matcha/hifigan/models.py class ResBlock1 (line 14) | class ResBlock1(torch.nn.Module): method __init__ (line 15) | def __init__(self, h, channels, kernel_size=3, dilation=(1, 3, 5)): method forward (line 90) | def forward(self, x): method remove_weight_norm (line 99) | def remove_weight_norm(self): class ResBlock2 (line 106) | class ResBlock2(torch.nn.Module): method __init__ (line 107) | def __init__(self, h, channels, kernel_size=3, dilation=(1, 3)): method forward (line 136) | def forward(self, x): method remove_weight_norm (line 143) | def remove_weight_norm(self): class Generator (line 148) | class Generator(torch.nn.Module): method __init__ (line 149) | def __init__(self, h): method forward (line 181) | def forward(self, x): method remove_weight_norm (line 199) | def remove_weight_norm(self): class DiscriminatorP (line 209) | class DiscriminatorP(torch.nn.Module): method __init__ (line 210) | def __init__(self, period, kernel_size=5, stride=3, use_spectral_norm=... method forward (line 225) | def forward(self, x): class MultiPeriodDiscriminator (line 247) | class MultiPeriodDiscriminator(torch.nn.Module): method __init__ (line 248) | def __init__(self): method forward (line 260) | def forward(self, y, y_hat): class DiscriminatorS (line 276) | class DiscriminatorS(torch.nn.Module): method __init__ (line 277) | def __init__(self, use_spectral_norm=False): method forward (line 293) | def forward(self, x): class MultiScaleDiscriminator (line 306) | class MultiScaleDiscriminator(torch.nn.Module): method __init__ (line 307) | def __init__(self): method forward (line 318) | def forward(self, y, y_hat): function feature_loss (line 337) | def feature_loss(fmap_r, fmap_g): function discriminator_loss (line 346) | def discriminator_loss(disc_real_outputs, disc_generated_outputs): function generator_loss (line 360) | def generator_loss(disc_outputs): FILE: xinference/thirdparty/matcha/hifigan/xutils.py function plot_spectrogram (line 14) | def plot_spectrogram(spectrogram): function init_weights (line 25) | def init_weights(m, mean=0.0, std=0.01): function apply_weight_norm (line 31) | def apply_weight_norm(m): function get_padding (line 37) | def get_padding(kernel_size, dilation=1): function load_checkpoint (line 41) | def load_checkpoint(filepath, device): function save_checkpoint (line 49) | def save_checkpoint(filepath, obj): function scan_checkpoint (line 55) | def scan_checkpoint(cp_dir, prefix): FILE: xinference/thirdparty/matcha/models/baselightningmodule.py class BaseLightningClass (line 19) | class BaseLightningClass(LightningModule, ABC): method update_data_statistics (line 20) | def update_data_statistics(self, data_statistics): method configure_optimizers (line 30) | def configure_optimizers(self) -> Any: method get_losses (line 56) | def get_losses(self, batch): method on_load_checkpoint (line 76) | def on_load_checkpoint(self, checkpoint: Dict[str, Any]) -> None: method training_step (line 79) | def training_step(self, batch: Any, batch_idx: int): method validation_step (line 128) | def validation_step(self, batch: Any, batch_idx: int): method on_validation_end (line 168) | def on_validation_end(self) -> None: method on_before_optimizer_step (line 209) | def on_before_optimizer_step(self, optimizer): FILE: xinference/thirdparty/matcha/models/components/decoder.py class SinusoidalPosEmb (line 14) | class SinusoidalPosEmb(torch.nn.Module): method __init__ (line 15) | def __init__(self, dim): method forward (line 20) | def forward(self, x, scale=1000): class Block1D (line 32) | class Block1D(torch.nn.Module): method __init__ (line 33) | def __init__(self, dim, dim_out, groups=8): method forward (line 41) | def forward(self, x, mask): class ResnetBlock1D (line 46) | class ResnetBlock1D(torch.nn.Module): method __init__ (line 47) | def __init__(self, dim, dim_out, time_emb_dim, groups=8): method forward (line 56) | def forward(self, x, mask, time_emb): class Downsample1D (line 64) | class Downsample1D(nn.Module): method __init__ (line 65) | def __init__(self, dim): method forward (line 69) | def forward(self, x): class TimestepEmbedding (line 73) | class TimestepEmbedding(nn.Module): method __init__ (line 74) | def __init__( method forward (line 105) | def forward(self, sample, condition=None): class Upsample1D (line 120) | class Upsample1D(nn.Module): method __init__ (line 134) | def __init__(self, channels, use_conv=False, use_conv_transpose=True, ... method forward (line 148) | def forward(self, inputs): class ConformerWrapper (line 161) | class ConformerWrapper(ConformerBlock): method __init__ (line 162) | def __init__( # pylint: disable=useless-super-delegation method forward (line 189) | def forward( class Decoder (line 200) | class Decoder(nn.Module): method __init__ (line 201) | def __init__( method get_block (line 319) | def get_block(block_type, dim, attention_head_dim, num_heads, dropout,... method initialize_weights (line 345) | def initialize_weights(self): method forward (line 363) | def forward(self, x, mask, mu, t, spks=None, cond=None): FILE: xinference/thirdparty/matcha/models/components/flow_matching.py class BASECFM (line 12) | class BASECFM(torch.nn.Module, ABC): method __init__ (line 13) | def __init__( method forward (line 33) | def forward(self, mu, mask, n_timesteps, temperature=1.0, spks=None, c... method solve_euler (line 55) | def solve_euler(self, x, t_span, mu, mask, spks, cond): method compute_loss (line 87) | def compute_loss(self, x1, mask, mu, spks=None, cond=None): class CFM (line 121) | class CFM(BASECFM): method __init__ (line 122) | def __init__(self, in_channels, out_channel, cfm_params, decoder_param... FILE: xinference/thirdparty/matcha/models/components/text_encoder.py class LayerNorm (line 15) | class LayerNorm(nn.Module): method __init__ (line 16) | def __init__(self, channels, eps=1e-4): method forward (line 24) | def forward(self, x): class ConvReluNorm (line 36) | class ConvReluNorm(nn.Module): method __init__ (line 37) | def __init__(self, in_channels, hidden_channels, out_channels, kernel_... method forward (line 60) | def forward(self, x, x_mask): class DurationPredictor (line 70) | class DurationPredictor(nn.Module): method __init__ (line 71) | def __init__(self, in_channels, filter_channels, kernel_size, p_dropout): method forward (line 84) | def forward(self, x, x_mask): class RotaryPositionalEmbeddings (line 97) | class RotaryPositionalEmbeddings(nn.Module): method __init__ (line 107) | def __init__(self, d: int, base: int = 10_000): method _build_cache (line 119) | def _build_cache(self, x: torch.Tensor): method _neg_half (line 147) | def _neg_half(self, x: torch.Tensor): method forward (line 154) | def forward(self, x: torch.Tensor): class MultiHeadAttention (line 175) | class MultiHeadAttention(nn.Module): method __init__ (line 176) | def __init__( method forward (line 216) | def forward(self, x, c, attn_mask=None): method attention (line 226) | def attention(self, query, key, value, mask=None): method _attention_bias_proximal (line 249) | def _attention_bias_proximal(length): class FFN (line 255) | class FFN(nn.Module): method __init__ (line 256) | def __init__(self, in_channels, out_channels, filter_channels, kernel_... method forward (line 268) | def forward(self, x, x_mask): class Encoder (line 276) | class Encoder(nn.Module): method __init__ (line 277) | def __init__( method forward (line 314) | def forward(self, x, x_mask): class TextEncoder (line 328) | class TextEncoder(nn.Module): method __init__ (line 329) | def __init__( method forward (line 378) | def forward(self, x, x_lengths, spks=None): FILE: xinference/thirdparty/matcha/models/components/transformer.py class SnakeBeta (line 17) | class SnakeBeta(nn.Module): method __init__ (line 35) | def __init__(self, in_features, out_features, alpha=1.0, alpha_trainab... method forward (line 64) | def forward(self, x): class FeedForward (line 83) | class FeedForward(nn.Module): method __init__ (line 96) | def __init__( method forward (line 131) | def forward(self, hidden_states): class BasicTransformerBlock (line 138) | class BasicTransformerBlock(nn.Module): method __init__ (line 159) | def __init__( method set_chunk_feed_forward (line 238) | def set_chunk_feed_forward(self, chunk_size: Optional[int], dim: int): method forward (line 243) | def forward( FILE: xinference/thirdparty/matcha/models/matcha_tts.py class MatchaTTS (line 23) | class MatchaTTS(BaseLightningClass): # 🍵 method __init__ (line 24) | def __init__( method synthesise (line 76) | def synthesise(self, x, x_lengths, n_timesteps, temperature=1.0, spks=... method forward (line 152) | def forward(self, x, x_lengths, y, y_lengths, spks=None, out_size=None... FILE: xinference/thirdparty/matcha/onnx/export.py class MatchaWithVocoder (line 22) | class MatchaWithVocoder(LightningModule): method __init__ (line 23) | def __init__(self, matcha, vocoder): method forward (line 28) | def forward(self, x, x_lengths, scales, spks=None): function get_exportable_module (line 35) | def get_exportable_module(matcha, vocoder, n_timesteps): function get_inputs (line 63) | def get_inputs(is_multi_speaker): function main (line 91) | def main(): FILE: xinference/thirdparty/matcha/onnx/infer.py function validate_args (line 15) | def validate_args(args): function write_wavs (line 24) | def write_wavs(model, inputs, output_dir, external_vocoder=None): function write_mels (line 66) | def write_mels(model, inputs, output_dir): function main (line 85) | def main(): FILE: xinference/thirdparty/matcha/text/__init__.py function text_to_sequence (line 10) | def text_to_sequence(text, cleaner_names): function cleaned_text_to_sequence (line 27) | def cleaned_text_to_sequence(cleaned_text): function sequence_to_text (line 38) | def sequence_to_text(sequence): function _clean_text (line 47) | def _clean_text(text, cleaner_names): FILE: xinference/thirdparty/matcha/text/cleaners.py function expand_abbreviations (line 65) | def expand_abbreviations(text): function lowercase (line 71) | def lowercase(text): function collapse_whitespace (line 75) | def collapse_whitespace(text): function convert_to_ascii (line 79) | def convert_to_ascii(text): function basic_cleaners (line 83) | def basic_cleaners(text): function transliteration_cleaners (line 90) | def transliteration_cleaners(text): function english_cleaners2 (line 98) | def english_cleaners2(text): FILE: xinference/thirdparty/matcha/text/numbers.py function _remove_commas (line 16) | def _remove_commas(m): function _expand_decimal_point (line 20) | def _expand_decimal_point(m): function _expand_dollars (line 24) | def _expand_dollars(m): function _expand_ordinal (line 45) | def _expand_ordinal(m): function _expand_number (line 49) | def _expand_number(m): function normalize_numbers (line 64) | def normalize_numbers(text): FILE: xinference/thirdparty/matcha/train.py function train (line 35) | def train(cfg: DictConfig) -> Tuple[Dict[str, Any], Dict[str, Any]]: function main (line 101) | def main(cfg: DictConfig) -> Optional[float]: FILE: xinference/thirdparty/matcha/utils/audio.py function load_wav (line 10) | def load_wav(full_path): function dynamic_range_compression (line 15) | def dynamic_range_compression(x, C=1, clip_val=1e-5): function dynamic_range_decompression (line 19) | def dynamic_range_decompression(x, C=1): function dynamic_range_compression_torch (line 23) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 27) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 31) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 36) | def spectral_de_normalize_torch(magnitudes): function mel_spectrogram (line 45) | def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_siz... FILE: xinference/thirdparty/matcha/utils/generate_data_statistics.py function compute_data_statistics (line 25) | def compute_data_statistics(data_loader: torch.utils.data.DataLoader, ou... function main (line 50) | def main(): FILE: xinference/thirdparty/matcha/utils/get_durations_from_trained_model.py function save_durations_to_folder (line 31) | def save_durations_to_folder( function compute_durations (line 44) | def compute_durations(data_loader: torch.utils.data.DataLoader, model: n... function main (line 82) | def main(): FILE: xinference/thirdparty/matcha/utils/instantiators.py function instantiate_callbacks (line 13) | def instantiate_callbacks(callbacks_cfg: DictConfig) -> List[Callback]: function instantiate_loggers (line 36) | def instantiate_loggers(logger_cfg: DictConfig) -> List[Logger]: FILE: xinference/thirdparty/matcha/utils/logging_utils.py function log_hyperparameters (line 12) | def log_hyperparameters(object_dict: Dict[str, Any]) -> None: FILE: xinference/thirdparty/matcha/utils/model.py function sequence_mask (line 7) | def sequence_mask(length, max_length=None): function fix_len_compatibility (line 14) | def fix_len_compatibility(length, num_downsamplings_in_unet=2): function convert_pad_shape (line 23) | def convert_pad_shape(pad_shape): function generate_path (line 29) | def generate_path(duration, mask): function duration_loss (line 44) | def duration_loss(logw, logw_, lengths): function normalize (line 49) | def normalize(data, mu, std): function denormalize (line 71) | def denormalize(data, mu, std): FILE: xinference/thirdparty/matcha/utils/monotonic_align/__init__.py function maximum_path (line 7) | def maximum_path(value, mask): FILE: xinference/thirdparty/matcha/utils/pylogger.py function get_pylogger (line 6) | def get_pylogger(name: str = __name__) -> logging.Logger: FILE: xinference/thirdparty/matcha/utils/rich_utils.py function print_config_tree (line 18) | def print_config_tree( function enforce_tags (line 80) | def enforce_tags(cfg: DictConfig, save_to_file: bool = False) -> None: FILE: xinference/thirdparty/matcha/utils/utils.py function extras (line 21) | def extras(cfg: DictConfig) -> None: function task_wrapper (line 52) | def task_wrapper(task_func: Callable) -> Callable: function get_metric_value (line 107) | def get_metric_value(metric_dict: Dict[str, Any], metric_name: str) -> f... function intersperse (line 131) | def intersperse(lst, item): function save_figure_to_numpy (line 138) | def save_figure_to_numpy(fig): function plot_tensor (line 144) | def plot_tensor(tensor): function save_plot (line 156) | def save_plot(tensor, savepath): function to_numpy (line 167) | def to_numpy(tensor): function get_user_data_dir (line 178) | def get_user_data_dir(appname="matcha_tts"): function assert_model_downloaded (line 209) | def assert_model_downloaded(checkpoint_path, url, use_wget=True): function get_phoneme_durations (line 223) | def get_phoneme_durations(durations, phones): FILE: xinference/thirdparty/megatts3/tts/frontend_function.py function g2p (line 24) | def g2p(self, text_inp): function align (line 40) | def align(self, wav): function make_dur_prompt (line 77) | def make_dur_prompt(self, mel2ph_ref, ph_ref, tone_ref): function dur_pred (line 95) | def dur_pred(self, ctx_dur_tokens, incremental_state_dur_prompt, ph_pred... function prepare_inputs_for_dit (line 148) | def prepare_inputs_for_dit(self, mel2ph_ref, mel2ph_pred, ph_ref, tone_r... FILE: xinference/thirdparty/megatts3/tts/gradio_api.py function model_worker (line 24) | def model_worker(input_queue, output_queue, device_id): function main (line 48) | def main(inp_audio, inp_npy, inp_text, infer_timestep, p_w, t_w, process... FILE: xinference/thirdparty/megatts3/tts/infer_cli.py function convert_to_wav (line 41) | def convert_to_wav(wav_path): function cut_wav (line 59) | def cut_wav(wav_path, max_len=28): class MegaTTS3DiTInfer (line 64) | class MegaTTS3DiTInfer(): method __init__ (line 65) | def __init__( method build_model (line 98) | def build_model(self, device): method preprocess (line 163) | def preprocess(self, audio_bytes, latent_file=None, topk_dur=1, **kwar... method forward (line 202) | def forward(self, resource_context, input_text, time_step, p_w, t_w, d... FILE: xinference/thirdparty/megatts3/tts/modules/aligner/whisper_small.py class LayerNorm (line 42) | class LayerNorm(nn.LayerNorm): method forward (line 43) | def forward(self, x: Tensor) -> Tensor: class Linear (line 47) | class Linear(nn.Linear): method forward (line 48) | def forward(self, x: Tensor) -> Tensor: class Conv1d (line 56) | class Conv1d(nn.Conv1d): method _conv_forward (line 57) | def _conv_forward( function sinusoids (line 65) | def sinusoids(length, channels, max_timescale=10000): function disable_sdpa (line 75) | def disable_sdpa(): class MultiHeadAttention (line 84) | class MultiHeadAttention(nn.Module): method __init__ (line 87) | def __init__(self, n_state: int, n_head: int): method forward (line 95) | def forward( method qkv_attention (line 118) | def qkv_attention( class ResidualAttentionBlock (line 134) | class ResidualAttentionBlock(nn.Module): method __init__ (line 135) | def __init__(self, n_state: int, n_head: int, cross_attention: bool = ... method forward (line 152) | def forward( class AudioEncoder (line 168) | class AudioEncoder(nn.Module): method __init__ (line 169) | def __init__( method forward (line 182) | def forward(self, x: Tensor, attn_mask: Tensor): class TextDecoder (line 201) | class TextDecoder(nn.Module): method __init__ (line 202) | def __init__( method forward (line 220) | def forward(self, x: Tensor, attn_mask: Tensor, xa: Tensor, kv_cache: ... class Whisper (line 246) | class Whisper(nn.Module): method __init__ (line 247) | def __init__(self): method embed_audio (line 261) | def embed_audio(self, mel: torch.Tensor): method logits (line 264) | def logits(self, tokens, audio_features, kv_cache=None): method forward (line 267) | def forward( method device (line 275) | def device(self): method install_kv_cache_hooks (line 278) | def install_kv_cache_hooks(self, cache: Optional[dict] = None): method sequence_mask (line 311) | def sequence_mask(self, seq_lens, max_len=None, device='cpu'): FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/ar_dur_predictor.py function fill_with_neg_inf2 (line 37) | def fill_with_neg_inf2(t): function expand_states (line 41) | def expand_states(h, mel2token): class CodePredictor (line 48) | class CodePredictor(nn.Module): method __init__ (line 49) | def __init__(self, hparams, hidden_size, dec_hidden_size, lm_num_layer... method forward_ling_encoder (line 87) | def forward_ling_encoder( method sample_one_step (line 130) | def sample_one_step(self, vq_pred): method forward_style_embed (line 148) | def forward_style_embed(self, spk_embed=None, spk_id=None, mel_ref=None): method buffered_future_mask (line 159) | def buffered_future_mask(self, tensor): class ARDurPredictor (line 171) | class ARDurPredictor(CodePredictor): method __init__ (line 172) | def __init__(self, hparams, hidden_size, dec_hidden_size, lm_num_layer... method forward (line 190) | def forward(self, txt_tokens, ling_feas, char_tokens, ph2char, bert_em... method infer (line 265) | def infer(self, txt_tokens, ling_feas, char_tokens, ph2char, bert_embed, method streaming_infer (line 322) | def streaming_infer(self, txt_tokens, ling_feas, char_tokens, ph2char,... FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/commons/layers.py class LayerNorm (line 19) | class LayerNorm(torch.nn.LayerNorm): method __init__ (line 25) | def __init__(self, nout, dim=-1, eps=1e-5): method forward (line 30) | def forward(self, x): class Reshape (line 41) | class Reshape(nn.Module): method __init__ (line 42) | def __init__(self, *args): method forward (line 46) | def forward(self, x): class Permute (line 50) | class Permute(nn.Module): method __init__ (line 51) | def __init__(self, *args): method forward (line 55) | def forward(self, x): function Embedding (line 59) | def Embedding(num_embeddings, embedding_dim, padding_idx=None): FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/commons/nar_tts_modules.py class LengthRegulator (line 23) | class LengthRegulator(torch.nn.Module): method __init__ (line 24) | def __init__(self, pad_value=0.0): method forward (line 28) | def forward(self, dur, dur_padding=None, alpha=1.0): class PosEmb (line 61) | class PosEmb(nn.Module): method __init__ (line 62) | def __init__(self, dim): method forward (line 70) | def forward(self, x): FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/commons/rel_transformer.py function convert_pad_shape (line 23) | def convert_pad_shape(pad_shape): function shift_1d (line 29) | def shift_1d(x): function sequence_mask (line 34) | def sequence_mask(length, max_length=None): class Encoder (line 41) | class Encoder(nn.Module): method __init__ (line 42) | def __init__(self, hidden_channels, filter_channels, n_heads, n_layers... method forward (line 71) | def forward(self, x, x_mask, attn_mask=1): class MultiHeadAttention (line 100) | class MultiHeadAttention(nn.Module): method __init__ (line 101) | def __init__(self, channels, out_channels, n_heads, window_size=None, ... method forward (line 135) | def forward(self, x, c, attn_mask=None): method attention (line 145) | def attention(self, query, key, value, mask=None): method _matmul_with_relative_values (line 178) | def _matmul_with_relative_values(self, x, y): method _matmul_with_relative_keys (line 187) | def _matmul_with_relative_keys(self, x, y): method _get_relative_embeddings (line 196) | def _get_relative_embeddings(self, relative_embeddings, length): method _relative_position_to_absolute_position (line 211) | def _relative_position_to_absolute_position(self, x): method _absolute_position_to_relative_position (line 228) | def _absolute_position_to_relative_position(self, x): method _attention_bias_proximal (line 242) | def _attention_bias_proximal(self, length): class FFN (line 254) | class FFN(nn.Module): method __init__ (line 255) | def __init__(self, in_channels, out_channels, filter_channels, kernel_... method forward (line 268) | def forward(self, x, x_mask): class LayerNorm (line 279) | class LayerNorm(nn.Module): method __init__ (line 280) | def __init__(self, channels, eps=1e-4): method forward (line 288) | def forward(self, x): class ConvReluNorm (line 300) | class ConvReluNorm(nn.Module): method __init__ (line 301) | def __init__(self, in_channels, hidden_channels, out_channels, kernel_... method forward (line 325) | def forward(self, x, x_mask): class RelTransformerEncoder (line 335) | class RelTransformerEncoder(nn.Module): method __init__ (line 336) | def __init__(self, method forward (line 387) | def forward(self, x, x_mask=None, other_embeds=0, attn_mask=1): FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/commons/rot_transformer.py class SinusoidalPositionalEmbedding (line 29) | class SinusoidalPositionalEmbedding(nn.Module): method __init__ (line 35) | def __init__(self, embedding_dim, padding_idx, init_size=1024): method get_embedding (line 47) | def get_embedding(num_embeddings, embedding_dim, padding_idx=None): method forward (line 65) | def forward(self, input, incremental_state=None, timestep=None, positi... method max_positions (line 86) | def max_positions(self): class RotaryEmbeddings (line 91) | class RotaryEmbeddings(nn.Module): method __init__ (line 96) | def __init__( method _create_rotary_embed (line 134) | def _create_rotary_embed(self, *, width: int, length: int): method _rotate (line 149) | def _rotate(self, input: torch.Tensor): method forward (line 164) | def forward(self, input: torch.Tensor, *, positions: Optional[torch.Te... class RotMultiheadAttention (line 206) | class RotMultiheadAttention(MultiheadAttention): method __init__ (line 207) | def __init__(self, embed_dim, num_heads, kdim=None, vdim=None, dropout... method forward (line 215) | def forward( class RotMultiheadAttention2 (line 404) | class RotMultiheadAttention2(MultiheadAttention): method __init__ (line 405) | def __init__(self, embed_dim, num_heads, kdim=None, vdim=None, dropout... method forward (line 413) | def forward( class RotDecSALayer (line 543) | class RotDecSALayer(nn.Module): method __init__ (line 544) | def __init__(self, c, num_heads, dropout, attention_dropout=0.1, relu_... method forward (line 559) | def forward( method clear_buffer (line 604) | def clear_buffer(self, input, encoder_out=None, encoder_padding_mask=N... method set_buffer (line 608) | def set_buffer(self, name, tensor, incremental_state): class RotDecSALayer2 (line 612) | class RotDecSALayer2(RotDecSALayer): method __init__ (line 613) | def __init__(self, c, num_heads, dropout, attention_dropout=0.1, relu_... class RotTransformerDecoderLayer (line 622) | class RotTransformerDecoderLayer(nn.Module): method __init__ (line 623) | def __init__(self, hidden_size, dropout, kernel_size=9, num_heads=8, f... method forward (line 642) | def forward(self, x, **kwargs): method clear_buffer (line 645) | def clear_buffer(self, *args): method set_buffer (line 648) | def set_buffer(self, *args): FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/commons/seq_utils.py function make_positions (line 20) | def make_positions(tensor, padding_idx): function softmax (line 35) | def softmax(x, dim): function sequence_mask (line 39) | def sequence_mask(lengths, maxlen=None, dtype=torch.bool): function weights_nonzero_speech (line 47) | def weights_nonzero_speech(target): function _get_full_incremental_state_key (line 57) | def _get_full_incremental_state_key(module_instance, key): function get_incremental_state (line 69) | def get_incremental_state(module, incremental_state, key): function set_incremental_state (line 77) | def set_incremental_state(module, incremental_state, key, value): function fill_with_neg_inf (line 84) | def fill_with_neg_inf(t): function fill_with_neg_inf2 (line 89) | def fill_with_neg_inf2(t): function select_attn (line 94) | def select_attn(attn_logits, type='best'): function make_pad_mask (line 112) | def make_pad_mask(lengths, xs=None, length_dim=-1): function make_non_pad_mask (line 218) | def make_non_pad_mask(lengths, xs=None, length_dim=-1): function get_mask_from_lengths (line 298) | def get_mask_from_lengths(lengths): function group_hidden_by_segs (line 305) | def group_hidden_by_segs(h, seg_ids, max_len): function expand_by_repeat_times (line 321) | def expand_by_repeat_times(source_encoding, lengths): function expand_word2ph (line 338) | def expand_word2ph(word_encoding, ph2word): FILE: xinference/thirdparty/megatts3/tts/modules/ar_dur/commons/transformer.py class SinusoidalPositionalEmbedding (line 27) | class SinusoidalPositionalEmbedding(nn.Module): method __init__ (line 33) | def __init__(self, embedding_dim, padding_idx, init_size=1024): method get_embedding (line 45) | def get_embedding(num_embeddings, embedding_dim, padding_idx=None): method forward (line 63) | def forward(self, input, incremental_state=None, timestep=None, positi... method max_positions (line 84) | def max_positions(self): class TransformerFFNLayer (line 89) | class TransformerFFNLayer(nn.Module): method __init__ (line 90) | def __init__(self, hidden_size, filter_size, padding="SAME", kernel_si... method forward (line 105) | def forward(self, x, incremental_state=None): method _get_input_buffer (line 129) | def _get_input_buffer(self, incremental_state): method _set_input_buffer (line 136) | def _set_input_buffer(self, incremental_state, buffer): method clear_buffer (line 144) | def clear_buffer(self, incremental_state): class MultiheadAttention (line 152) | class MultiheadAttention(nn.Module): method __init__ (line 153) | def __init__(self, embed_dim, num_heads, kdim=None, vdim=None, dropout... method reset_parameters (line 201) | def reset_parameters(self): method forward (line 218) | def forward( method in_proj_qkv (line 432) | def in_proj_qkv(self, query): method in_proj_q (line 435) | def in_proj_q(self, query): method in_proj_k (line 444) | def in_proj_k(self, key): method in_proj_v (line 454) | def in_proj_v(self, value): method _in_proj (line 464) | def _in_proj(self, input, start=0, end=None): method _get_input_buffer (line 472) | def _get_input_buffer(self, incremental_state): method _set_input_buffer (line 479) | def _set_input_buffer(self, incremental_state, buffer): method apply_sparse_mask (line 487) | def apply_sparse_mask(self, attn_weights, tgt_len, src_len, bsz): method clear_buffer (line 490) | def clear_buffer(self, incremental_state=None): class EncSALayer (line 500) | class EncSALayer(nn.Module): method __init__ (line 501) | def __init__(self, c, num_heads, dropout, attention_dropout=0.1, method forward (line 516) | def forward(self, x, encoder_padding_mask=None, **kwargs): class DecSALayer (line 543) | class DecSALayer(nn.Module): method __init__ (line 544) | def __init__(self, c, num_heads, dropout, attention_dropout=0.1, relu_... method forward (line 562) | def forward( method clear_buffer (line 631) | def clear_buffer(self, input, encoder_out=None, encoder_padding_mask=N... method set_buffer (line 635) | def set_buffer(self, name, tensor, incremental_state): class TransformerEncoderLayer (line 639) | class TransformerEncoderLayer(nn.Module): method __init__ (line 640) | def __init__(self, hidden_size, dropout, kernel_size=9, num_heads=2, f... method forward (line 650) | def forward(self, x, **kwargs): class TransformerDecoderLayer (line 654) | class TransformerDecoderLayer(nn.Module): method __init__ (line 655) | def __init__(self, hidden_size, dropout, kernel_size=9, num_heads=2, f... method forward (line 666) | def forward(self, x, **kwargs): method clear_buffer (line 669) | def clear_buffer(self, *args): method set_buffer (line 672) | def set_buffer(self, *args): class FFTBlocks (line 676) | class FFTBlocks(nn.Module): method __init__ (line 677) | def __init__(self, hidden_size, num_layers, ffn_kernel_size=9, dropout... method forward (line 706) | def forward(self, x, padding_mask=None, attn_mask=None, return_hiddens... class FastSpeechEncoder (line 734) | class FastSpeechEncoder(FFTBlocks): method __init__ (line 735) | def __init__(self, dict_size, hidden_size=256, num_layers=4, kernel_si... method forward (line 746) | def forward(self, txt_tokens, attn_mask=None, other_embeds=0): method forward_embedding (line 760) | def forward_embedding(self, txt_tokens): FILE: xinference/thirdparty/megatts3/tts/modules/llm_dit/cfm.py class LogitNormalTrainingTimesteps (line 36) | class LogitNormalTrainingTimesteps: method __init__ (line 37) | def __init__(self, T=1000.0, loc=0.0, scale=1.0): method sample (line 42) | def sample(self, size, device): function pad_t_like_x (line 47) | def pad_t_like_x(t, x): class ConditionalFlowMatcher (line 71) | class ConditionalFlowMatcher: method __init__ (line 82) | def __init__(self, sigma: Union[float, int] = 0.0): method compute_mu_t (line 92) | def compute_mu_t(self, x0, x1, t): method compute_sigma_t (line 115) | def compute_sigma_t(self, t): method sample_xt (line 134) | def sample_xt(self, x0, x1, t, epsilon): method compute_conditional_flow (line 161) | def compute_conditional_flow(self, x0, x1, t, xt): method sample_noise_like (line 186) | def sample_noise_like(self, x): method sample_location_and_conditional_flow (line 189) | def sample_location_and_conditional_flow(self, x0, x1, t=None, return_... method compute_lambda (line 233) | def compute_lambda(self, t): class VariancePreservingConditionalFlowMatcher (line 252) | class VariancePreservingConditionalFlowMatcher(ConditionalFlowMatcher): method compute_mu_t (line 260) | def compute_mu_t(self, x0, x1, t): method compute_conditional_flow (line 282) | def compute_conditional_flow(self, x0, x1, t, xt): FILE: xinference/thirdparty/megatts3/tts/modules/llm_dit/dit.py class Diffusion (line 27) | class Diffusion(nn.Module): method __init__ (line 28) | def __init__(self): method forward (line 70) | def forward(self, inputs, sigmas=None, x_noisy=None): method forward_ling_encoder (line 101) | def forward_ling_encoder(self, txt_tokens, tone_tokens): method _forward (line 114) | def _forward(self, x, local_cond, x_ling, timesteps, ctx_mask, dur=Non... method inference (line 127) | def inference(self, inputs, timesteps=20, seq_cfg_w=[1.0, 1.0], **kwar... FILE: xinference/thirdparty/megatts3/tts/modules/llm_dit/time_embedding.py class SinusPositionEmbedding (line 20) | class SinusPositionEmbedding(nn.Module): method __init__ (line 21) | def __init__(self, dim): method forward (line 25) | def forward(self, x, scale=1000): class TimestepEmbedding (line 34) | class TimestepEmbedding(nn.Module): method __init__ (line 35) | def __init__(self, dim, freq_embed_dim=256): method forward (line 40) | def forward(self, timestep): # noqa: F821 FILE: xinference/thirdparty/megatts3/tts/modules/llm_dit/transformer.py function precompute_freqs_cis (line 23) | def precompute_freqs_cis(dim: int, end: int, theta: float = 10000.0): function reshape_for_broadcast (line 31) | def reshape_for_broadcast(freqs_cis: torch.Tensor, x: torch.Tensor): function apply_rotary_emb (line 39) | def apply_rotary_emb( class AdaLNZero (line 52) | class AdaLNZero(nn.Module): method __init__ (line 53) | def __init__(self, dim): method forward (line 59) | def forward(self, x, emb=None): class AdaLNZero_Out (line 66) | class AdaLNZero_Out(nn.Module): method __init__ (line 67) | def __init__(self, dim): method forward (line 73) | def forward(self, x, emb): class Attention (line 80) | class Attention(nn.Module): method __init__ (line 81) | def __init__(self, encoder_dim, encoder_n_heads, max_seq_len): method forward (line 107) | def forward( class FeedForward (line 130) | class FeedForward(nn.Module): method __init__ (line 131) | def __init__( method forward (line 150) | def forward(self, x): class TransformerBlock (line 154) | class TransformerBlock(nn.Module): method __init__ (line 155) | def __init__(self, encoder_dim, encoder_n_heads, max_seq_len): method forward (line 170) | def forward( class Transformer (line 207) | class Transformer(nn.Module): method __init__ (line 208) | def __init__(self, encoder_n_layers, encoder_dim, encoder_n_heads, max... method forward (line 224) | def forward(self, x, t, attn_mask, start_pos=0): FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/decoder/diag_gaussian.py class DiagonalGaussianDistribution (line 18) | class DiagonalGaussianDistribution(object): method __init__ (line 19) | def __init__(self, parameters: torch.Tensor, deterministic: bool = Fal... method sample (line 31) | def sample(self, generator=None) -> torch.Tensor: method kl (line 42) | def kl(self, other: "DiagonalGaussianDistribution" = None) -> torch.Te... method nll (line 57) | def nll(self, sample, dims) -> torch.Tensor: method mode (line 66) | def mode(self) -> torch.Tensor: FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/decoder/hifigan_modules.py function init_weights (line 25) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 31) | def get_padding(kernel_size, dilation=1): class Upsample (line 35) | class Upsample(nn.Module): method __init__ (line 36) | def __init__(self, mult, r): method forward (line 52) | def forward(self, x): class Downsample (line 59) | class Downsample(nn.Module): method __init__ (line 60) | def __init__(self, mult, r): method forward (line 70) | def forward(self, x): function weights_init (line 75) | def weights_init(m): function weights_zero_init (line 84) | def weights_zero_init(m): function WNConv1d (line 91) | def WNConv1d(*args, **kwargs): function WNConvTranspose1d (line 95) | def WNConvTranspose1d(*args, **kwargs): class Audio2Mel (line 99) | class Audio2Mel(nn.Module): method __init__ (line 100) | def __init__( method forward (line 129) | def forward(self, audio): class ResnetBlock (line 149) | class ResnetBlock(nn.Module): method __init__ (line 150) | def __init__(self, dim, dilation=1, dim_in=None): method forward (line 164) | def forward(self, x): class ResBlockMRFV2 (line 174) | class ResBlockMRFV2(torch.nn.Module): method __init__ (line 175) | def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)): method forward (line 197) | def forward(self, x): method remove_weight_norm (line 206) | def remove_weight_norm(self): class ResBlockMRFV2Inter (line 213) | class ResBlockMRFV2Inter(torch.nn.Module): method __init__ (line 214) | def __init__(self, channels, kernel_size=3): method forward (line 220) | def forward(self, x): class Generator (line 228) | class Generator(nn.Module): method __init__ (line 229) | def __init__(self, input_size_, ngf, n_residual_layers, num_band, args... method forward (line 265) | def forward(self, mel, step=None): FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/decoder/seanet_encoder.py class Encoder (line 21) | class Encoder(nn.Module): method __init__ (line 22) | def __init__( method forward (line 35) | def forward(self, audio: torch.Tensor): FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/decoder/wavvae_v3.py class WavVAE_V3 (line 25) | class WavVAE_V3(nn.Module): method __init__ (line 26) | def __init__(self, hparams=None): method encode_latent (line 41) | def encode_latent(self, audio): method encode (line 46) | def encode(self, audio): method decode (line 52) | def decode(self, latent): method forward (line 56) | def forward(self, audio): FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/encoder/common_modules/conv.py function apply_parametrization_norm (line 47) | def apply_parametrization_norm(module: nn.Module, norm: str = 'none') ->... function get_norm_module (line 57) | def get_norm_module(module: nn.Module, causal: bool = False, norm: str =... function get_extra_padding_for_conv1d (line 71) | def get_extra_padding_for_conv1d(x: torch.Tensor, kernel_size: int, stri... function pad1d (line 79) | def pad1d(x: torch.Tensor, paddings: tp.Tuple[int, int], mode: str = 'ze... class ConvLayerNorm (line 96) | class ConvLayerNorm(nn.LayerNorm): method __init__ (line 97) | def __init__(self, normalized_shape: tp.Union[int, tp.List[int], torch... method forward (line 100) | def forward(self, x): class NormConv1d (line 107) | class NormConv1d(nn.Module): method __init__ (line 108) | def __init__(self, *args, causal: bool = False, norm: str = 'none', method forward (line 115) | def forward(self, x): class SConv1d (line 121) | class SConv1d(nn.Module): method __init__ (line 122) | def __init__(self, in_channels: int, out_channels: int, method forward (line 138) | def forward(self, x): FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/encoder/common_modules/lstm.py class SLSTM (line 34) | class SLSTM(nn.Module): method __init__ (line 39) | def __init__(self, dimension: int, num_layers: int = 2, skip: bool = T... method forward (line 45) | def forward(self, x): FILE: xinference/thirdparty/megatts3/tts/modules/wavvae/encoder/common_modules/seanet.py class SEANetResnetBlock (line 41) | class SEANetResnetBlock(nn.Module): method __init__ (line 42) | def __init__(self, dim: int, kernel_sizes: tp.List[int] = [3, 1], dila... method forward (line 68) | def forward(self, x): class SEANetEncoder (line 72) | class SEANetEncoder(nn.Module): method __init__ (line 73) | def __init__(self, channels: int = 1, dimension: int = 128, n_filters:... method forward (line 125) | def forward(self, x): FILE: xinference/thirdparty/megatts3/tts/utils/audio_utils/align.py function mel2token_to_dur (line 17) | def mel2token_to_dur(mel2token, T_txt=None, max_dur=None): FILE: xinference/thirdparty/megatts3/tts/utils/audio_utils/io.py function to_wav_bytes (line 25) | def to_wav_bytes(wav, sr, norm=False): function save_wav (line 39) | def save_wav(wav_bytes, path): function to_mp3 (line 46) | def to_mp3(out_path): function convert_to_wav (line 55) | def convert_to_wav(wav_path): function convert_to_wav_bytes (line 73) | def convert_to_wav_bytes(audio_binary): function combine_audio_segments (line 83) | def combine_audio_segments(segments, crossfade_duration=0.16, sr=24000): FILE: xinference/thirdparty/megatts3/tts/utils/audio_utils/plot.py function spec_to_figure (line 25) | def spec_to_figure(spec, vmin=None, vmax=None, title='', f0s=None, dur_i... function align_to_figure (line 73) | def align_to_figure(align, dur_info): FILE: xinference/thirdparty/megatts3/tts/utils/commons/ckpt_utils.py function dist_load (line 28) | def dist_load(path): function torch_load_dist (line 48) | def torch_load_dist(path, map_location='cpu'): function get_last_checkpoint (line 54) | def get_last_checkpoint(work_dir, steps=None): function get_all_ckpts (line 64) | def get_all_ckpts(work_dir, steps=None): function load_ckpt (line 73) | def load_ckpt(cur_model, ckpt_base_dir, model_name='model', force=True, ... function load_with_size_mismatch (line 161) | def load_with_size_mismatch(model, state_dict, prefix=""): FILE: xinference/thirdparty/megatts3/tts/utils/commons/hparams.py class Args (line 26) | class Args: method __init__ (line 27) | def __init__(self, **kwargs): function override_config (line 32) | def override_config(old_config: dict, new_config: dict): function traverse_dict (line 42) | def traverse_dict(d, func, ctx): function parse_config (line 51) | def parse_config(v, context=None): function remove_meta_key (line 66) | def remove_meta_key(d): function load_config (line 76) | def load_config(config_fn, config_chains, loaded_configs): function set_hparams (line 103) | def set_hparams(config='', exp_name='', hparams_str='', print_hparams=Tr... FILE: xinference/thirdparty/megatts3/tts/utils/text_utils/ph_tone_convert.py function map_phone_to_tokendict (line 18) | def map_phone_to_tokendict(item, pad_bos_eos=True): function split_ph_timestamp (line 39) | def split_ph_timestamp(ph_timestamp): function split_ph (line 72) | def split_ph(ph_seq): FILE: xinference/thirdparty/megatts3/tts/utils/text_utils/split_text.py function chunk_text_chinese (line 17) | def chunk_text_chinese(text, limit=60): function chunk_text_english (line 59) | def chunk_text_english(text, max_chars=130): FILE: xinference/thirdparty/megatts3/tts/utils/text_utils/text_encoder.py function strip_ids (line 44) | def strip_ids(ids, ids_to_strip): class TextEncoder (line 52) | class TextEncoder(object): method __init__ (line 55) | def __init__(self, num_reserved_ids=NUM_RESERVED_TOKENS): method num_reserved_ids (line 59) | def num_reserved_ids(self): method encode (line 62) | def encode(self, s): method decode (line 78) | def decode(self, ids, strip_extraneous=False): method decode_list (line 95) | def decode_list(self, ids): method vocab_size (line 117) | def vocab_size(self): class TokenTextEncoder (line 121) | class TokenTextEncoder(TextEncoder): method __init__ (line 124) | def __init__(self, method encode (line 161) | def encode(self, s): method decode (line 174) | def decode(self, ids, strip_eos=False, strip_padding=False): method decode_list (line 183) | def decode_list(self, ids): method vocab_size (line 188) | def vocab_size(self): method __len__ (line 191) | def __len__(self): method _safe_id_to_token (line 194) | def _safe_id_to_token(self, idx): method _init_vocab_from_file (line 197) | def _init_vocab_from_file(self, filename): method _init_vocab_from_list (line 212) | def _init_vocab_from_list(self, vocab_list): method _init_vocab (line 229) | def _init_vocab(self, token_generator, add_reserved_tokens=True): method pad (line 245) | def pad(self): method eos (line 248) | def eos(self): method unk (line 251) | def unk(self): method seg (line 254) | def seg(self): method store_to_file (line 257) | def store_to_file(self, filename): method sil_phonemes (line 270) | def sil_phonemes(self): function build_token_encoder (line 274) | def build_token_encoder(token_list_file): function is_sil_phoneme (line 279) | def is_sil_phoneme(p): FILE: xinference/thirdparty/melo/api.py class TTS (line 20) | class TTS(nn.Module): method __init__ (line 21) | def __init__(self, method audio_numpy_concat (line 66) | def audio_numpy_concat(segment_data_list, sr, speed=1.): method split_sentences_into_pieces (line 75) | def split_sentences_into_pieces(text, language, quiet=False): method tts_to_file (line 83) | def tts_to_file(self, text, speaker_id, output_path=None, sdp_ratio=0.... FILE: xinference/thirdparty/melo/app.py function synthesize (line 31) | def synthesize(speaker, text, speed, language, progress=gr.Progress()): function load_speakers (line 35) | def load_speakers(language, text): function main (line 57) | def main(share, host, port): FILE: xinference/thirdparty/melo/attentions.py class LayerNorm (line 12) | class LayerNorm(nn.Module): method __init__ (line 13) | def __init__(self, channels, eps=1e-5): method forward (line 21) | def forward(self, x): function fused_add_tanh_sigmoid_multiply (line 28) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): class Encoder (line 37) | class Encoder(nn.Module): method __init__ (line 38) | def __init__( method forward (line 98) | def forward(self, x, x_mask, g=None): class Decoder (line 118) | class Decoder(nn.Module): method __init__ (line 119) | def __init__( method forward (line 178) | def forward(self, x, x_mask, h, h_mask): class MultiHeadAttention (line 204) | class MultiHeadAttention(nn.Module): method __init__ (line 205) | def __init__( method forward (line 258) | def forward(self, x, c, attn_mask=None): method attention (line 268) | def attention(self, query, key, value, mask=None): method _matmul_with_relative_values (line 319) | def _matmul_with_relative_values(self, x, y): method _matmul_with_relative_keys (line 328) | def _matmul_with_relative_keys(self, x, y): method _get_relative_embeddings (line 337) | def _get_relative_embeddings(self, relative_embeddings, length): method _relative_position_to_absolute_position (line 355) | def _relative_position_to_absolute_position(self, x): method _absolute_position_to_relative_position (line 376) | def _absolute_position_to_relative_position(self, x): method _attention_bias_proximal (line 392) | def _attention_bias_proximal(self, length): class FFN (line 404) | class FFN(nn.Module): method __init__ (line 405) | def __init__( method forward (line 433) | def forward(self, x, x_mask): method _causal_padding (line 443) | def _causal_padding(self, x): method _same_padding (line 452) | def _same_padding(self, x): FILE: xinference/thirdparty/melo/commons.py function init_weights (line 6) | def init_weights(m, mean=0.0, std=0.01): function get_padding (line 12) | def get_padding(kernel_size, dilation=1): function convert_pad_shape (line 16) | def convert_pad_shape(pad_shape): function intersperse (line 22) | def intersperse(lst, item): function kl_divergence (line 28) | def kl_divergence(m_p, logs_p, m_q, logs_q): function rand_gumbel (line 37) | def rand_gumbel(shape): function rand_gumbel_like (line 43) | def rand_gumbel_like(x): function slice_segments (line 48) | def slice_segments(x, ids_str, segment_size=4): function rand_slice_segments (line 57) | def rand_slice_segments(x, x_lengths=None, segment_size=4): function get_timing_signal_1d (line 67) | def get_timing_signal_1d(length, channels, min_timescale=1.0, max_timesc... function add_timing_signal_1d (line 83) | def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4): function cat_timing_signal_1d (line 89) | def cat_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4, axis... function subsequent_mask (line 95) | def subsequent_mask(length): function fused_add_tanh_sigmoid_multiply (line 101) | def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels): function convert_pad_shape (line 110) | def convert_pad_shape(pad_shape): function shift_1d (line 116) | def shift_1d(x): function sequence_mask (line 121) | def sequence_mask(length, max_length=None): function generate_path (line 128) | def generate_path(duration, mask): function clip_grad_value_ (line 145) | def clip_grad_value_(parameters, clip_value, norm_type=2): FILE: xinference/thirdparty/melo/data_utils.py class TextAudioSpeakerLoader (line 17) | class TextAudioSpeakerLoader(torch.utils.data.Dataset): method __init__ (line 24) | def __init__(self, audiopaths_sid_text, hparams): method _filter (line 53) | def _filter(self): method get_audio_text_speaker_pair (line 94) | def get_audio_text_speaker_pair(self, audiopath_sid_text): method get_audio (line 107) | def get_audio(self, filename): method get_text (line 150) | def get_text(self, text, word2ph, phone, tone, language_str, wav_path): method get_sid (line 189) | def get_sid(self, sid): method __getitem__ (line 193) | def __getitem__(self, index): method __len__ (line 196) | def __len__(self): class TextAudioSpeakerCollate (line 200) | class TextAudioSpeakerCollate: method __init__ (line 203) | def __init__(self, return_ids=False): method __call__ (line 206) | def __call__(self, batch): class DistributedBucketSampler (line 285) | class DistributedBucketSampler(torch.utils.data.distributed.DistributedS... method __init__ (line 295) | def __init__( method _create_buckets (line 314) | def _create_buckets(self): method __iter__ (line 346) | def __iter__(self): method _bisect (line 397) | def _bisect(self, x, lo=0, hi=None): method __len__ (line 412) | def __len__(self): FILE: xinference/thirdparty/melo/download_utils.py function load_or_download_config (line 44) | def load_or_download_config(locale, use_hf=True, config_path=None): function load_or_download_model (line 55) | def load_or_download_model(locale, device, use_hf=True, ckpt_path=None): function load_pretrain_model (line 66) | def load_pretrain_model(): FILE: xinference/thirdparty/melo/infer.py function main (line 12) | def main(ckpt_path, text, language, output_dir): FILE: xinference/thirdparty/melo/losses.py function feature_loss (line 4) | def feature_loss(fmap_r, fmap_g): function discriminator_loss (line 15) | def discriminator_loss(disc_real_outputs, disc_generated_outputs): function generator_loss (line 31) | def generator_loss(disc_outputs): function kl_loss (line 43) | def kl_loss(z_p, logs_q, m_p, logs_p, z_mask): FILE: xinference/thirdparty/melo/main.py function main (line 14) | def main(text, file, output_path, language, speaker, speed, device): FILE: xinference/thirdparty/melo/mel_processing.py function dynamic_range_compression_torch (line 9) | def dynamic_range_compression_torch(x, C=1, clip_val=1e-5): function dynamic_range_decompression_torch (line 18) | def dynamic_range_decompression_torch(x, C=1): function spectral_normalize_torch (line 27) | def spectral_normalize_torch(magnitudes): function spectral_de_normalize_torch (line 32) | def spectral_de_normalize_torch(magnitudes): function spectrogram_torch (line 41) | def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, cente... function spectrogram_torch_conv (line 79) | def spectrogram_torch_conv(y, n_fft, sampling_rate, hop_size, win_size, ... function spec_to_mel_torch (line 118) | def spec_to_mel_torch(spec, n_fft, num_mels, sampling_rate, fmin, fmax): function mel_spectrogram_torch (line 132) | def mel_spectrogram_torch( FILE: xinference/thirdparty/melo/models.py class DurationDiscriminator (line 17) | class DurationDiscriminator(nn.Module): # vits2 method __init__ (line 18) | def __init__( method forward_probability (line 53) | def forward_probability(self, x, x_mask, dur, g=None): method forward (line 69) | def forward(self, x, x_mask, dur_r, dur_hat, g=None): class TransformerCouplingBlock (line 91) | class TransformerCouplingBlock(nn.Module): method __init__ (line 92) | def __init__( method forward (line 147) | def forward(self, x, x_mask, g=None, reverse=False): class StochasticDurationPredictor (line 157) | class StochasticDurationPredictor(nn.Module): method __init__ (line 158) | def __init__( method forward (line 206) | def forward(self, x, x_mask, w=None, g=None, reverse=False, noise_scal... class DurationPredictor (line 268) | class DurationPredictor(nn.Module): method __init__ (line 269) | def __init__( method forward (line 294) | def forward(self, x, x_mask, g=None): class TextEncoder (line 311) | class TextEncoder(nn.Module): method __init__ (line 312) | def __init__( method forward (line 360) | def forward(self, x, x_lengths, tone, language, bert, ja_bert, g=None): class ResidualCouplingBlock (line 384) | class ResidualCouplingBlock(nn.Module): method __init__ (line 385) | def __init__( method forward (line 419) | def forward(self, x, x_mask, g=None, reverse=False): class PosteriorEncoder (line 429) | class PosteriorEncoder(nn.Module): method __init__ (line 430) | def __init__( method forward (line 459) | def forward(self, x, x_lengths, g=None, tau=1.0): class Generator (line 471) | class Generator(torch.nn.Module): method __init__ (line 472) | def __init__( method forward (line 519) | def forward(self, x, g=None): method remove_weight_norm (line 540) | def remove_weight_norm(self): class DiscriminatorP (line 548) | class DiscriminatorP(torch.nn.Module): method __init__ (line 549) | def __init__(self, period, kernel_size=5, stride=3, use_spectral_norm=... method forward (line 605) | def forward(self, x): class DiscriminatorS (line 627) | class DiscriminatorS(torch.nn.Module): method __init__ (line 628) | def __init__(self, use_spectral_norm=False): method forward (line 643) | def forward(self, x): class MultiPeriodDiscriminator (line 657) | class MultiPeriodDiscriminator(torch.nn.Module): method __init__ (line 658) | def __init__(self, use_spectral_norm=False): method forward (line 668) | def forward(self, y, y_hat): class ReferenceEncoder (line 684) | class ReferenceEncoder(nn.Module): method __init__ (line 690) | def __init__(self, spec_channels, gin_channels=0, layernorm=False): method forward (line 724) | def forward(self, inputs, mask=None): method calculate_channels (line 746) | def calculate_channels(self, L, kernel_size, stride, pad, n_convs): class SynthesizerTrn (line 752) | class SynthesizerTrn(nn.Module): method __init__ (line 757) | def __init__( method forward (line 888) | def forward(self, x, x_lengths, y, y_lengths, sid, tone, language, ber... method infer (line 966) | def infer( method voice_conversion (line 1023) | def voice_conversion(self, y, y_lengths, sid_src, sid_tgt, tau=1.0): FILE: xinference/thirdparty/melo/modules.py class LayerNorm (line 17) | class LayerNorm(nn.Module): method __init__ (line 18) | def __init__(self, channels, eps=1e-5): method forward (line 26) | def forward(self, x): class ConvReluNorm (line 32) | class ConvReluNorm(nn.Module): method __init__ (line 33) | def __init__( method forward (line 74) | def forward(self, x, x_mask): class DDSConv (line 84) | class DDSConv(nn.Module): method __init__ (line 89) | def __init__(self, channels, kernel_size, n_layers, p_dropout=0.0): method forward (line 118) | def forward(self, x, x_mask, g=None): class WN (line 133) | class WN(torch.nn.Module): method __init__ (line 134) | def __init__( method forward (line 185) | def forward(self, x, x_mask, g=None, **kwargs): method remove_weight_norm (line 212) | def remove_weight_norm(self): class ResBlock1 (line 221) | class ResBlock1(torch.nn.Module): method __init__ (line 222) | def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)): method forward (line 296) | def forward(self, x, x_mask=None): method remove_weight_norm (line 311) | def remove_weight_norm(self): class ResBlock2 (line 318) | class ResBlock2(torch.nn.Module): method __init__ (line 319) | def __init__(self, channels, kernel_size=3, dilation=(1, 3)): method forward (line 347) | def forward(self, x, x_mask=None): method remove_weight_norm (line 358) | def remove_weight_norm(self): class Log (line 363) | class Log(nn.Module): method forward (line 364) | def forward(self, x, x_mask, reverse=False, **kwargs): class Flip (line 374) | class Flip(nn.Module): method forward (line 375) | def forward(self, x, *args, reverse=False, **kwargs): class ElementwiseAffine (line 384) | class ElementwiseAffine(nn.Module): method __init__ (line 385) | def __init__(self, channels): method forward (line 391) | def forward(self, x, x_mask, reverse=False, **kwargs): class ResidualCouplingLayer (line 402) | class ResidualCouplingLayer(nn.Module): method __init__ (line 403) | def __init__( method forward (line 437) | def forward(self, x, x_mask, g=None, reverse=False): class ConvFlow (line 459) | class ConvFlow(nn.Module): method __init__ (line 460) | def __init__( method forward (line 486) | def forward(self, x, x_mask, g=None, reverse=False): class TransformerCouplingLayer (line 519) | class TransformerCouplingLayer(nn.Module): method __init__ (line 520) | def __init__( method forward (line 562) | def forward(self, x, x_mask, g=None, reverse=False): FILE: xinference/thirdparty/melo/monotonic_align/__init__.py function maximum_path (line 7) | def maximum_path(neg_cent, mask): FILE: xinference/thirdparty/melo/monotonic_align/core.py function maximum_path_jit (line 14) | def maximum_path_jit(paths, values, t_ys, t_xs): FILE: xinference/thirdparty/melo/preprocess_text.py function main (line 30) | def main( FILE: xinference/thirdparty/melo/split_utils.py function split_sentence (line 9) | def split_sentence(text, min_len=10, language_str='EN'): function split_sentences_latin (line 17) | def split_sentences_latin(text, min_len=10): function split_sentences_zh (line 26) | def split_sentences_zh(text, min_len=10): function merge_short_sentences_en (line 51) | def merge_short_sentences_en(sens): function merge_short_sentences_zh (line 77) | def merge_short_sentences_zh(sens): function txtsplit (line 105) | def txtsplit(text, desired_length=100, max_length=200): FILE: xinference/thirdparty/melo/text/__init__.py function cleaned_text_to_sequence (line 7) | def cleaned_text_to_sequence(cleaned_text, tones, language, symbol_to_id... function get_bert (line 23) | def get_bert(norm_text, word2ph, language, device): FILE: xinference/thirdparty/melo/text/chinese.py function replace_punctuation (line 55) | def replace_punctuation(text): function g2p (line 68) | def g2p(text): function _get_initials_finals (line 80) | def _get_initials_finals(word): function _g2p (line 93) | def _g2p(segments): function text_normalize (line 171) | def text_normalize(text): function get_bert_feature (line 179) | def get_bert_feature(text, word2ph, device=None): FILE: xinference/thirdparty/melo/text/chinese_bert.py function get_bert_feature (line 13) | def get_bert_feature(text, word2ph, device=None, model_id='hfl/chinese-r... FILE: xinference/thirdparty/melo/text/chinese_mix.py function replace_punctuation (line 59) | def replace_punctuation(text): function g2p (line 69) | def g2p(text, impl='v2'): function _get_initials_finals (line 87) | def _get_initials_finals(word): function _g2p (line 101) | def _g2p(segments): function text_normalize (line 189) | def text_normalize(text): function get_bert_feature (line 197) | def get_bert_feature(text, word2ph, device): function _g2p_v2 (line 202) | def _g2p_v2(segments): FILE: xinference/thirdparty/melo/text/cleaner.py function clean_text (line 9) | def clean_text(text, language): function clean_text_bert (line 16) | def clean_text_bert(text, language, device=None): function text_to_sequence (line 30) | def text_to_sequence(text, language): FILE: xinference/thirdparty/melo/text/cleaner_multiling.py function replace_punctuation (line 43) | def replace_punctuation(text): function lowercase (line 48) | def lowercase(text): function collapse_whitespace (line 52) | def collapse_whitespace(text): function remove_punctuation_at_begin (line 55) | def remove_punctuation_at_begin(text): function remove_aux_symbols (line 58) | def remove_aux_symbols(text): function replace_symbols (line 63) | def replace_symbols(text, lang="en"): function unicleaners (line 98) | def unicleaners(text, cased=False, lang='en'): FILE: xinference/thirdparty/melo/text/english.py function post_replace_ph (line 95) | def post_replace_ph(ph): function read_dict (line 118) | def read_dict(): function cache_dict (line 142) | def cache_dict(g2p_dict, file_path): function get_dict (line 147) | def get_dict(): function refine_ph (line 161) | def refine_ph(phn): function refine_syllables (line 169) | def refine_syllables(syllables): function text_normalize (line 181) | def text_normalize(text): function g2p_old (line 190) | def g2p_old(text): function g2p (line 217) | def g2p(text, pad_start_end=True, tokenized=None): function get_bert_feature (line 262) | def get_bert_feature(text, word2ph, device=None): FILE: xinference/thirdparty/melo/text/english_bert.py function get_bert_feature (line 9) | def get_bert_feature(text, word2ph, device=None): FILE: xinference/thirdparty/melo/text/english_utils/abbreviations.py function expand_abbreviations (line 28) | def expand_abbreviations(text, lang="en"): FILE: xinference/thirdparty/melo/text/english_utils/number_norm.py function _remove_commas (line 16) | def _remove_commas(m): function _expand_decimal_point (line 20) | def _expand_decimal_point(m): function __expand_currency (line 24) | def __expand_currency(value: str, inflection: Dict[float, str]) -> str: function _expand_currency (line 42) | def _expand_currency(m: "re.Match") -> str: function _expand_ordinal (line 74) | def _expand_ordinal(m): function _expand_number (line 78) | def _expand_number(m): function normalize_numbers (line 91) | def normalize_numbers(text): FILE: xinference/thirdparty/melo/text/english_utils/time_norm.py function _expand_num (line 18) | def _expand_num(n: int) -> str: function _expand_time_english (line 22) | def _expand_time_english(match: "re.Match") -> str: function expand_time_english (line 46) | def expand_time_english(text: str) -> str: FILE: xinference/thirdparty/melo/text/es_phonemizer/base.py class BasePhonemizer (line 7) | class BasePhonemizer(abc.ABC): method __init__ (line 34) | def __init__(self, language, punctuations=Punctuation.default_puncs(),... method _init_language (line 46) | def _init_language(self, language): method language (line 57) | def language(self): method name (line 63) | def name(): method is_available (line 69) | def is_available(cls): method version (line 75) | def version(cls): method supported_languages (line 81) | def supported_languages(): method is_supported_language (line 85) | def is_supported_language(self, language): method _phonemize (line 90) | def _phonemize(self, text, separator): method _phonemize_preprocess (line 93) | def _phonemize_preprocess(self, text) -> Tuple[List[str], List]: method _phonemize_postprocess (line 107) | def _phonemize_postprocess(self, phonemized, punctuations) -> str: method phonemize (line 116) | def phonemize(self, text: str, separator="|", language: str = None) ->... method print_logs (line 137) | def print_logs(self, level: int = 0): FILE: xinference/thirdparty/melo/text/es_phonemizer/cleaner.py function replace_punctuation (line 43) | def replace_punctuation(text): function lowercase (line 48) | def lowercase(text): function collapse_whitespace (line 52) | def collapse_whitespace(text): function remove_punctuation_at_begin (line 55) | def remove_punctuation_at_begin(text): function remove_aux_symbols (line 58) | def remove_aux_symbols(text): function replace_symbols (line 63) | def replace_symbols(text, lang="en"): function spanish_cleaners (line 98) | def spanish_cleaners(text): FILE: xinference/thirdparty/melo/text/es_phonemizer/es_to_ipa.py function es2ipa (line 4) | def es2ipa(text): FILE: xinference/thirdparty/melo/text/es_phonemizer/gruut_wrapper.py class Gruut (line 14) | class Gruut(BasePhonemizer): method __init__ (line 41) | def __init__( method name (line 54) | def name(): method phonemize_gruut (line 57) | def phonemize_gruut(self, text: str, separator: str = "|", tie=False) ... method _phonemize (line 109) | def _phonemize(self, text, separator): method is_supported_language (line 112) | def is_supported_language(self, language): method supported_languages (line 117) | def supported_languages() -> List: method version (line 125) | def version(self): method is_available (line 134) | def is_available(cls): FILE: xinference/thirdparty/melo/text/es_phonemizer/punctuation.py class PuncPosition (line 12) | class PuncPosition(Enum): class Punctuation (line 21) | class Punctuation: method __init__ (line 43) | def __init__(self, puncs: str = _DEF_PUNCS): method default_puncs (line 47) | def default_puncs(): method puncs (line 52) | def puncs(self): method puncs (line 56) | def puncs(self, value): method strip (line 62) | def strip(self, text): method strip_to_restore (line 74) | def strip_to_restore(self, text): method _strip_to_restore (line 88) | def _strip_to_restore(self, text): method restore (line 120) | def restore(cls, text, puncs): method _restore (line 135) | def _restore(cls, text, puncs, num): # pylint: disable=too-many-retur... FILE: xinference/thirdparty/melo/text/fr_phonemizer/base.py class BasePhonemizer (line 7) | class BasePhonemizer(abc.ABC): method __init__ (line 34) | def __init__(self, language, punctuations=Punctuation.default_puncs(),... method _init_language (line 46) | def _init_language(self, language): method language (line 57) | def language(self): method name (line 63) | def name(): method is_available (line 69) | def is_available(cls): method version (line 75) | def version(cls): method supported_languages (line 81) | def supported_languages(): method is_supported_language (line 85) | def is_supported_language(self, language): method _phonemize (line 90) | def _phonemize(self, text, separator): method _phonemize_preprocess (line 93) | def _phonemize_preprocess(self, text) -> Tuple[List[str], List]: method _phonemize_postprocess (line 107) | def _phonemize_postprocess(self, phonemized, punctuations) -> str: method phonemize (line 116) | def phonemize(self, text: str, separator="|", language: str = None) ->... method print_logs (line 137) | def print_logs(self, level: int = 0): FILE: xinference/thirdparty/melo/text/fr_phonemizer/cleaner.py function replace_punctuation (line 48) | def replace_punctuation(text): function expand_abbreviations (line 53) | def expand_abbreviations(text, lang="fr"): function lowercase (line 61) | def lowercase(text): function collapse_whitespace (line 65) | def collapse_whitespace(text): function remove_punctuation_at_begin (line 68) | def remove_punctuation_at_begin(text): function remove_aux_symbols (line 71) | def remove_aux_symbols(text): function replace_symbols (line 76) | def replace_symbols(text, lang="en"): function french_cleaners (line 111) | def french_cleaners(text): FILE: xinference/thirdparty/melo/text/fr_phonemizer/fr_to_ipa.py function remove_consecutive_t (line 5) | def remove_consecutive_t(input_str): function fr2ipa (line 23) | def fr2ipa(text): FILE: xinference/thirdparty/melo/text/fr_phonemizer/gruut_wrapper.py class Gruut (line 14) | class Gruut(BasePhonemizer): method __init__ (line 41) | def __init__( method name (line 54) | def name(): method phonemize_gruut (line 57) | def phonemize_gruut(self, text: str, separator: str = "|", tie=False) ... method _phonemize (line 109) | def _phonemize(self, text, separator): method is_supported_language (line 112) | def is_supported_language(self, language): method supported_languages (line 117) | def supported_languages() -> List: method version (line 125) | def version(self): method is_available (line 134) | def is_available(cls): FILE: xinference/thirdparty/melo/text/fr_phonemizer/punctuation.py class PuncPosition (line 12) | class PuncPosition(Enum): class Punctuation (line 21) | class Punctuation: method __init__ (line 43) | def __init__(self, puncs: str = _DEF_PUNCS): method default_puncs (line 47) | def default_puncs(): method puncs (line 52) | def puncs(self): method puncs (line 56) | def puncs(self, value): method strip (line 62) | def strip(self, text): method strip_to_restore (line 74) | def strip_to_restore(self, text): method _strip_to_restore (line 88) | def _strip_to_restore(self, text): method restore (line 118) | def restore(cls, text, puncs): method _restore (line 133) | def _restore(cls, text, puncs, num): # pylint: disable=too-many-retur... FILE: xinference/thirdparty/melo/text/french.py function distribute_phone (line 11) | def distribute_phone(n_phone, n_word): function text_normalize (line 19) | def text_normalize(text): function g2p (line 26) | def g2p(text, pad_start_end=True, tokenized=None): function get_bert_feature (line 66) | def get_bert_feature(text, word2ph, device=None): function text_normalize (line 83) | def text_normalize(text): FILE: xinference/thirdparty/melo/text/french_bert.py function get_bert_feature (line 9) | def get_bert_feature(text, word2ph, device=None): FILE: xinference/thirdparty/melo/text/japanese.py function _makerulemap (line 325) | def _makerulemap(): function kata2phoneme (line 333) | def kata2phoneme(text: str) -> str: function hira2kata (line 360) | def hira2kata(text: str) -> str: function text2kata (line 370) | def text2kata(text: str) -> str: function japanese_convert_numbers_to_words (line 467) | def japanese_convert_numbers_to_words(text: str) -> str: function japanese_convert_alpha_symbols_to_words (line 474) | def japanese_convert_alpha_symbols_to_words(text: str) -> str: function japanese_text_to_phonemes (line 478) | def japanese_text_to_phonemes(text: str) -> str: function is_japanese_character (line 488) | def is_japanese_character(char): function replace_punctuation (line 524) | def replace_punctuation(text): function text_normalize (line 548) | def text_normalize(text): function distribute_phone (line 557) | def distribute_phone(n_phone, n_word): function g2p (line 571) | def g2p(norm_text): function get_bert_feature (line 614) | def get_bert_feature(text, word2ph, device): FILE: xinference/thirdparty/melo/text/japanese_bert.py function get_bert_feature (line 8) | def get_bert_feature(text, word2ph, device=None, model_id='tohoku-nlp/be... FILE: xinference/thirdparty/melo/text/korean.py function normalize (line 16) | def normalize(text): function normalize_with_dictionary (line 25) | def normalize_with_dictionary(text, dic): function normalize_english (line 32) | def normalize_english(text): function korean_text_to_phonemes (line 44) | def korean_text_to_phonemes(text, character: str = "hangeul") -> str: function text_normalize (line 73) | def text_normalize(text): function distribute_phone (line 82) | def distribute_phone(n_phone, n_word): function g2p (line 97) | def g2p(norm_text): function get_bert_feature (line 141) | def get_bert_feature(text, word2ph, device='cuda'): FILE: xinference/thirdparty/melo/text/spanish.py function distribute_phone (line 11) | def distribute_phone(n_phone, n_word): function text_normalize (line 19) | def text_normalize(text): function post_replace_ph (line 23) | def post_replace_ph(ph): function refine_ph (line 44) | def refine_ph(phn): function refine_syllables (line 52) | def refine_syllables(syllables): function g2p (line 68) | def g2p(text, pad_start_end=True, tokenized=None): function get_bert_feature (line 108) | def get_bert_feature(text, word2ph, device=None): FILE: xinference/thirdparty/melo/text/spanish_bert.py function get_bert_feature (line 9) | def get_bert_feature(text, word2ph, device=None): FILE: xinference/thirdparty/melo/text/tone_sandhi.py class ToneSandhi (line 22) | class ToneSandhi: method __init__ (line 23) | def __init__(self): method _neural_sandhi (line 466) | def _neural_sandhi(self, word: str, pos: str, finals: List[str]) -> Li... method _bu_sandhi (line 522) | def _bu_sandhi(self, word: str, finals: List[str]) -> List[str]: method _yi_sandhi (line 533) | def _yi_sandhi(self, word: str, finals: List[str]) -> List[str]: method _split_word (line 558) | def _split_word(self, word: str) -> List[str]: method _three_sandhi (line 571) | def _three_sandhi(self, word: str, finals: List[str]) -> List[str]: method _all_tone_three (line 611) | def _all_tone_three(self, finals: List[str]) -> bool: method _merge_bu (line 616) | def _merge_bu(self, seg: List[Tuple[str, str]]) -> List[Tuple[str, str]]: method _merge_yi (line 636) | def _merge_yi(self, seg: List[Tuple[str, str]]) -> List[Tuple[str, str]]: method _merge_continuous_three_tones (line 669) | def _merge_continuous_three_tones( method _is_reduplication (line 700) | def _is_reduplication(self, word: str) -> bool: method _merge_continuous_three_tones_2 (line 704) | def _merge_continuous_three_tones_2( method _merge_er (line 734) | def _merge_er(self, seg: List[Tuple[str, str]]) -> List[Tuple[str, str]]: method _merge_reduplication (line 743) | def _merge_reduplication(self, seg: List[Tuple[str, str]]) -> List[Tup... method pre_merge_for_modify (line 752) | def pre_merge_for_modify(self, seg: List[Tuple[str, str]]) -> List[Tup... method modified_tone (line 764) | def modified_tone(self, word: str, pos: str, finals: List[str]) -> Lis... FILE: xinference/thirdparty/melo/train.py function run (line 49) | def run(): function train_and_evaluate (line 291) | def train_and_evaluate( function evaluate (line 539) | def evaluate(hps, generator, eval_loader, writer_eval): FILE: xinference/thirdparty/melo/transforms.py function piecewise_rational_quadratic_transform (line 12) | def piecewise_rational_quadratic_transform( function searchsorted (line 45) | def searchsorted(bin_locations, inputs, eps=1e-6): function unconstrained_rational_quadratic_spline (line 50) | def unconstrained_rational_quadratic_spline( function rational_quadratic_spline (line 100) | def rational_quadratic_spline( FILE: xinference/thirdparty/melo/utils.py function get_text_for_tts_infer (line 22) | def get_text_for_tts_infer(text, language_str, hps, device, symbol_to_id... function load_checkpoint (line 60) | def load_checkpoint(checkpoint_path, model, optimizer=None, skip_optimiz... function save_checkpoint (line 119) | def save_checkpoint(model, optimizer, learning_rate, iteration, checkpoi... function summarize (line 140) | def summarize( function latest_checkpoint_path (line 159) | def latest_checkpoint_path(dir_path, regex="G_*.pth"): function plot_spectrogram_to_numpy (line 166) | def plot_spectrogram_to_numpy(spectrogram): function plot_alignment_to_numpy (line 192) | def plot_alignment_to_numpy(alignment, info=None): function load_wav_to_torch (line 223) | def load_wav_to_torch(full_path): function load_wav_to_torch_new (line 228) | def load_wav_to_torch_new(full_path): function load_wav_to_torch_librosa (line 233) | def load_wav_to_torch_librosa(full_path, sr): function load_filepaths_and_text (line 238) | def load_filepaths_and_text(filename, split="|"): function get_hparams (line 244) | def get_hparams(init=True): function clean_checkpoints (line 290) | def clean_checkpoints(path_to_models="logs/44k/", n_ckpts_to_keep=2, sor... function get_hparams_from_dir (line 335) | def get_hparams_from_dir(model_dir): function get_hparams_from_file (line 346) | def get_hparams_from_file(config_path): function check_git_hash (line 355) | def check_git_hash(model_dir): function get_logger (line 380) | def get_logger(model_dir, filename="train.log"): class HParams (line 395) | class HParams: method __init__ (line 396) | def __init__(self, **kwargs): method keys (line 402) | def keys(self): method items (line 405) | def items(self): method values (line 408) | def values(self): method __len__ (line 411) | def __len__(self): method __getitem__ (line 414) | def __getitem__(self, key): method __setitem__ (line 417) | def __setitem__(self, key, value): method __contains__ (line 420) | def __contains__(self, key): method __repr__ (line 423) | def __repr__(self): FILE: xinference/thirdparty/mlx/flux/autoencoder.py class AutoEncoderParams (line 12) | class AutoEncoderParams: class AttnBlock (line 24) | class AttnBlock(nn.Module): method __init__ (line 25) | def __init__(self, in_channels: int): method __call__ (line 41) | def __call__(self, x: mx.array) -> mx.array: class ResnetBlock (line 55) | class ResnetBlock(nn.Module): method __init__ (line 56) | def __init__(self, in_channels: int, out_channels: int): method __call__ (line 85) | def __call__(self, x): class Downsample (line 101) | class Downsample(nn.Module): method __init__ (line 102) | def __init__(self, in_channels: int): method __call__ (line 108) | def __call__(self, x: mx.array): class Upsample (line 114) | class Upsample(nn.Module): method __init__ (line 115) | def __init__(self, in_channels: int): method __call__ (line 121) | def __call__(self, x: mx.array): class Encoder (line 127) | class Encoder(nn.Module): method __init__ (line 128) | def __init__( method __call__ (line 183) | def __call__(self, x: mx.array): class Decoder (line 212) | class Decoder(nn.Module): method __init__ (line 213) | def __init__( method __call__ (line 271) | def __call__(self, z: mx.array): class DiagonalGaussian (line 300) | class DiagonalGaussian(nn.Module): method __call__ (line 301) | def __call__(self, z: mx.array): class AutoEncoder (line 311) | class AutoEncoder(nn.Module): method __init__ (line 312) | def __init__(self, params: AutoEncoderParams): method sanitize (line 336) | def sanitize(self, weights): method encode (line 347) | def encode(self, x: mx.array): method decode (line 352) | def decode(self, z: mx.array): method __call__ (line 356) | def __call__(self, x: mx.array): FILE: xinference/thirdparty/mlx/flux/clip.py class CLIPTextModelConfig (line 13) | class CLIPTextModelConfig: method from_dict (line 22) | def from_dict(cls, config): class CLIPOutput (line 34) | class CLIPOutput: class CLIPEncoderLayer (line 46) | class CLIPEncoderLayer(nn.Module): method __init__ (line 49) | def __init__(self, model_dims: int, num_heads: int, activation: str): method __call__ (line 62) | def __call__(self, x, attn_mask=None): class CLIPTextModel (line 76) | class CLIPTextModel(nn.Module): method __init__ (line 79) | def __init__(self, config: CLIPTextModelConfig): method _get_mask (line 90) | def _get_mask(self, N, dtype): method sanitize (line 96) | def sanitize(self, weights): method __call__ (line 127) | def __call__(self, x): FILE: xinference/thirdparty/mlx/flux/datasets.py class Dataset (line 7) | class Dataset: method __getitem__ (line 8) | def __getitem__(self, index: int): method __len__ (line 11) | def __len__(self): class LocalDataset (line 15) | class LocalDataset(Dataset): method __init__ (line 18) | def __init__(self, dataset: str, data_file): method __len__ (line 23) | def __len__(self): method __getitem__ (line 26) | def __getitem__(self, index: int): class LegacyDataset (line 32) | class LegacyDataset(LocalDataset): method __init__ (line 35) | def __init__(self, dataset: str): class HuggingFaceDataset (line 41) | class HuggingFaceDataset(Dataset): method __init__ (line 43) | def __init__(self, dataset: str): method __len__ (line 48) | def __len__(self): method __getitem__ (line 51) | def __getitem__(self, index: int): function load_dataset (line 56) | def load_dataset(dataset: str): FILE: xinference/thirdparty/mlx/flux/flux.py class FluxPipeline (line 22) | class FluxPipeline: method __init__ (line 23) | def __init__(self, name: str, model_path: str, t5_padding: bool = True): method ensure_models_are_loaded (line 37) | def ensure_models_are_loaded(self): method reload_text_encoders (line 45) | def reload_text_encoders(self): method tokenize (line 49) | def tokenize(self, text): method _prepare_latent_images (line 54) | def _prepare_latent_images(self, x): method _prepare_conditioning (line 74) | def _prepare_conditioning(self, n_images, t5_tokens, clip_tokens): method _denoising_loop (line 88) | def _denoising_loop( method generate_latents (line 129) | def generate_latents( method decode (line 158) | def decode(self, x, latent_size: Tuple[int, int] = (64, 64)): method generate_images (line 165) | def generate_images( method training_loss (line 196) | def training_loss( method linear_to_lora_layers (line 230) | def linear_to_lora_layers(self, rank: int = 8, num_blocks: int = -1): method fuse_lora_layers (line 242) | def fuse_lora_layers(self): FILE: xinference/thirdparty/mlx/flux/layers.py function _rope (line 12) | def _rope(pos: mx.array, dim: int, theta: float): function _ab_plus_cd (line 25) | def _ab_plus_cd(a, b, c, d): function _apply_rope (line 29) | def _apply_rope(x, pe): function _attention (line 36) | def _attention(q: mx.array, k: mx.array, v: mx.array, pe: mx.array): function timestep_embedding (line 46) | def timestep_embedding( class EmbedND (line 60) | class EmbedND(nn.Module): method __init__ (line 61) | def __init__(self, dim: int, theta: int, axes_dim: List[int]): method __call__ (line 68) | def __call__(self, ids: mx.array): class MLPEmbedder (line 78) | class MLPEmbedder(nn.Module): method __init__ (line 79) | def __init__(self, in_dim: int, hidden_dim: int): method __call__ (line 84) | def __call__(self, x: mx.array) -> mx.array: class QKNorm (line 88) | class QKNorm(nn.Module): method __init__ (line 89) | def __init__(self, dim: int): method __call__ (line 94) | def __call__(self, q: mx.array, k: mx.array) -> tuple[mx.array, mx.arr... class SelfAttention (line 98) | class SelfAttention(nn.Module): method __init__ (line 99) | def __init__(self, dim: int, num_heads: int = 8, qkv_bias: bool = False): method __call__ (line 108) | def __call__(self, x: mx.array, pe: mx.array) -> mx.array: class ModulationOut (line 123) | class ModulationOut: class Modulation (line 129) | class Modulation(nn.Module): method __init__ (line 130) | def __init__(self, dim: int, double: bool): method __call__ (line 136) | def __call__(self, x: mx.array) -> Tuple[ModulationOut, Optional[Modul... class DoubleStreamBlock (line 146) | class DoubleStreamBlock(nn.Module): method __init__ (line 147) | def __init__( method __call__ (line 181) | def __call__( class SingleStreamBlock (line 234) | class SingleStreamBlock(nn.Module): method __init__ (line 235) | def __init__( method __call__ (line 262) | def __call__(self, x: mx.array, vec: mx.array, pe: mx.array): class LastLayer (line 287) | class LastLayer(nn.Module): method __init__ (line 288) | def __init__(self, hidden_size: int, patch_size: int, out_channels: int): method __call__ (line 298) | def __call__(self, x: mx.array, vec: mx.array): FILE: xinference/thirdparty/mlx/flux/lora.py class LoRALinear (line 9) | class LoRALinear(nn.Module): method from_base (line 11) | def from_base( method fuse (line 28) | def fuse(self): method __init__ (line 45) | def __init__( method __call__ (line 73) | def __call__(self, x): FILE: xinference/thirdparty/mlx/flux/model.py class FluxParams (line 20) | class FluxParams: class Flux (line 35) | class Flux(nn.Module): method __init__ (line 36) | def __init__(self, params: FluxParams): method sanitize (line 85) | def sanitize(self, weights): method __call__ (line 97) | def __call__( FILE: xinference/thirdparty/mlx/flux/sampler.py class FluxSampler (line 9) | class FluxSampler: method __init__ (line 10) | def __init__(self, name: str, base_shift: float = 0.5, max_shift: floa... method _time_shift (line 15) | def _time_shift(self, x, t): method timesteps (line 23) | def timesteps( method random_timesteps (line 33) | def random_timesteps(self, B, L, dtype=mx.float32, key=None): method sample_prior (line 44) | def sample_prior(self, shape, dtype=mx.float32, key=None): method add_noise (line 47) | def add_noise(self, x, t, noise=None, key=None): method step (line 55) | def step(self, pred, x_t, t, t_prev): FILE: xinference/thirdparty/mlx/flux/t5.py class T5Config (line 35) | class T5Config: method from_dict (line 51) | def from_dict(cls, config): class RelativePositionBias (line 70) | class RelativePositionBias(nn.Module): method __init__ (line 71) | def __init__(self, config: T5Config, bidirectional: bool): method _relative_position_bucket (line 79) | def _relative_position_bucket(rpos, bidirectional, num_buckets, max_di... method __call__ (line 98) | def __call__(self, query_length: int, key_length: int, offset: int = 0): class MultiHeadAttention (line 119) | class MultiHeadAttention(nn.Module): method __init__ (line 120) | def __init__(self, config: T5Config): method __call__ (line 129) | def __call__( class DenseActivation (line 161) | class DenseActivation(nn.Module): method __init__ (line 162) | def __init__(self, config: T5Config): method __call__ (line 182) | def __call__(self, x): class TransformerEncoderLayer (line 192) | class TransformerEncoderLayer(nn.Module): method __init__ (line 193) | def __init__(self, config: T5Config): method __call__ (line 200) | def __call__(self, x, mask): class TransformerEncoder (line 210) | class TransformerEncoder(nn.Module): method __init__ (line 211) | def __init__(self, config: T5Config): method __call__ (line 219) | def __call__(self, x: mx.array): class T5Encoder (line 227) | class T5Encoder(nn.Module): method __init__ (line 228) | def __init__(self, config: T5Config): method sanitize (line 232) | def sanitize(self, weights): method __call__ (line 243) | def __call__(self, inputs: mx.array): FILE: xinference/thirdparty/mlx/flux/tokenizers.py class CLIPTokenizer (line 8) | class CLIPTokenizer: method __init__ (line 11) | def __init__(self, bpe_ranks, vocab, max_length=77): method bos (line 23) | def bos(self): method bos_token (line 27) | def bos_token(self): method eos (line 31) | def eos(self): method eos_token (line 35) | def eos_token(self): method bpe (line 38) | def bpe(self, text): method tokenize (line 83) | def tokenize(self, text, prepend_bos=True, append_eos=True): method encode (line 110) | def encode(self, text): class T5Tokenizer (line 122) | class T5Tokenizer: method __init__ (line 123) | def __init__(self, model_file, max_length=512): method pad (line 128) | def pad(self): method pad_token (line 135) | def pad_token(self): method bos (line 139) | def bos(self): method bos_token (line 146) | def bos_token(self): method eos (line 150) | def eos(self): method eos_token (line 157) | def eos_token(self): method tokenize (line 160) | def tokenize(self, text, prepend_bos=True, append_eos=True, pad=True): method encode (line 175) | def encode(self, text, pad=True): FILE: xinference/thirdparty/mlx/flux/trainer.py class Trainer (line 10) | class Trainer: method __init__ (line 12) | def __init__(self, flux: FluxPipeline, dataset: Dataset, args): method _random_crop_resize (line 20) | def _random_crop_resize(self, img): method _encode_image (line 62) | def _encode_image(self, input_img: ImageFile.ImageFile, num_augmentati... method _encode_prompt (line 71) | def _encode_prompt(self, prompt): method encode_dataset (line 79) | def encode_dataset(self): method iterate (line 86) | def iterate(self, batch_size): FILE: xinference/thirdparty/mlx/flux/utils.py class ModelSpec (line 18) | class ModelSpec: function load_flow_model (line 96) | def load_flow_model(name: str, ckpt_path: str): function load_ae (line 110) | def load_ae(name: str, ckpt_path: str): function load_clip (line 123) | def load_clip(name: str, ckpt_path: str): function load_t5 (line 139) | def load_t5(name: str, ckpt_path: str): function load_clip_tokenizer (line 163) | def load_clip_tokenizer(name: str, ckpt_path: str): function load_t5_tokenizer (line 177) | def load_t5_tokenizer(name: str, ckpt_path: str, pad: bool = True): FILE: xinference/thirdparty/whisper/__init__.py function _download (line 50) | def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]: function available_models (line 94) | def available_models() -> List[str]: function load_model (line 99) | def load_model( FILE: xinference/thirdparty/whisper/audio.py function load_audio (line 25) | def load_audio(file: str, sr: int = SAMPLE_RATE): function pad_or_trim (line 65) | def pad_or_trim(array, length: int = N_SAMPLES, *, axis: int = -1): function mel_filters (line 92) | def mel_filters(device, n_mels: int) -> torch.Tensor: function log_mel_spectrogram (line 110) | def log_mel_spectrogram( FILE: xinference/thirdparty/whisper/decoding.py function detect_language (line 19) | def detect_language( class DecodingOptions (line 81) | class DecodingOptions: class DecodingResult (line 118) | class DecodingResult: class Inference (line 130) | class Inference: method logits (line 131) | def logits(self, tokens: Tensor, audio_features: Tensor) -> Tensor: method rearrange_kv_cache (line 135) | def rearrange_kv_cache(self, source_indices) -> None: method cleanup_caching (line 139) | def cleanup_caching(self) -> None: class PyTorchInference (line 144) | class PyTorchInference(Inference): method __init__ (line 145) | def __init__(self, model: "Whisper", initial_token_length: int): method logits (line 155) | def logits(self, tokens: Tensor, audio_features: Tensor) -> Tensor: method cleanup_caching (line 165) | def cleanup_caching(self): method rearrange_kv_cache (line 172) | def rearrange_kv_cache(self, source_indices): class SequenceRanker (line 179) | class SequenceRanker: method rank (line 180) | def rank( class MaximumLikelihoodRanker (line 190) | class MaximumLikelihoodRanker(SequenceRanker): method __init__ (line 196) | def __init__(self, length_penalty: Optional[float]): method rank (line 199) | def rank(self, tokens: List[List[Tensor]], sum_logprobs: List[List[flo... class TokenDecoder (line 216) | class TokenDecoder: method reset (line 217) | def reset(self): method update (line 220) | def update( method finalize (line 247) | def finalize( class GreedyDecoder (line 272) | class GreedyDecoder(TokenDecoder): method __init__ (line 273) | def __init__(self, temperature: float, eot: int): method update (line 277) | def update( method finalize (line 295) | def finalize(self, tokens: Tensor, sum_logprobs: Tensor): class BeamSearchDecoder (line 301) | class BeamSearchDecoder(TokenDecoder): method __init__ (line 302) | def __init__( method reset (line 320) | def reset(self): method update (line 323) | def update( method finalize (line 384) | def finalize(self, preceding_tokens: Tensor, sum_logprobs: Tensor): class LogitFilter (line 407) | class LogitFilter: method apply (line 408) | def apply(self, logits: Tensor, tokens: Tensor) -> None: class SuppressBlank (line 423) | class SuppressBlank(LogitFilter): method __init__ (line 424) | def __init__(self, tokenizer: Tokenizer, sample_begin: int): method apply (line 428) | def apply(self, logits: Tensor, tokens: Tensor): class SuppressTokens (line 433) | class SuppressTokens(LogitFilter): method __init__ (line 434) | def __init__(self, suppress_tokens: Sequence[int]): method apply (line 437) | def apply(self, logits: Tensor, tokens: Tensor): class ApplyTimestampRules (line 441) | class ApplyTimestampRules(LogitFilter): method __init__ (line 442) | def __init__( method apply (line 452) | def apply(self, logits: Tensor, tokens: Tensor): class DecodingTask (line 508) | class DecodingTask: method __init__ (line 514) | def __init__(self, model: "Whisper", options: DecodingOptions): method _verify_options (line 572) | def _verify_options(self, options: DecodingOptions) -> DecodingOptions: method _get_initial_tokens (line 587) | def _get_initial_tokens(self) -> Tuple[int]: method _get_suppress_tokens (line 615) | def _get_suppress_tokens(self) -> Tuple[int]: method _get_audio_features (line 644) | def _get_audio_features(self, mel: Tensor): method _detect_language (line 666) | def _detect_language(self, audio_features: Tensor, tokens: Tensor): method _main_loop (line 680) | def _main_loop(self, audio_features: Tensor, tokens: Tensor): method run (line 713) | def run(self, mel: Tensor) -> List[DecodingResult]: function decode (line 793) | def decode( FILE: xinference/thirdparty/whisper/model.py class ModelDimensions (line 17) | class ModelDimensions: class LayerNorm (line 30) | class LayerNorm(nn.LayerNorm): method forward (line 31) | def forward(self, x: Tensor) -> Tensor: class Linear (line 35) | class Linear(nn.Linear): method forward (line 36) | def forward(self, x: Tensor) -> Tensor: class Conv1d (line 44) | class Conv1d(nn.Conv1d): method _conv_forward (line 45) | def _conv_forward( function sinusoids (line 53) | def sinusoids(length, channels, max_timescale=10000): class MultiHeadAttention (line 62) | class MultiHeadAttention(nn.Module): method __init__ (line 63) | def __init__(self, n_state: int, n_head: int): method forward (line 71) | def forward( method qkv_attention (line 93) | def qkv_attention( class ResidualAttentionBlock (line 111) | class ResidualAttentionBlock(nn.Module): method __init__ (line 112) | def __init__(self, n_state: int, n_head: int, cross_attention: bool = ... method forward (line 129) | def forward( class AudioEncoder (line 143) | class AudioEncoder(nn.Module): method __init__ (line 144) | def __init__( method forward (line 157) | def forward(self, x: Tensor): class TextDecoder (line 176) | class TextDecoder(nn.Module): method __init__ (line 177) | def __init__( method forward (line 196) | def forward(self, x: Tensor, xa: Tensor, kv_cache: Optional[dict] = No... class Whisper (line 221) | class Whisper(nn.Module): method __init__ (line 222) | def __init__(self, dims: ModelDimensions): method set_alignment_heads (line 247) | def set_alignment_heads(self, dump: bytes): method embed_audio (line 256) | def embed_audio(self, mel: torch.Tensor): method logits (line 259) | def logits(self, tokens: torch.Tensor, audio_features: torch.Tensor): method forward (line 262) | def forward( method device (line 268) | def device(self): method is_multilingual (line 272) | def is_multilingual(self): method num_languages (line 276) | def num_languages(self): method install_kv_cache_hooks (line 279) | def install_kv_cache_hooks(self, cache: Optional[dict] = None): FILE: xinference/thirdparty/whisper/normalizers/basic.py function remove_symbols_and_diacritics (line 27) | def remove_symbols_and_diacritics(s: str, keep=""): function remove_symbols (line 46) | def remove_symbols(s: str): class BasicTextNormalizer (line 56) | class BasicTextNormalizer: method __init__ (line 57) | def __init__(self, remove_diacritics: bool = False, split_letters: boo... method __call__ (line 63) | def __call__(self, s: str): FILE: xinference/thirdparty/whisper/normalizers/english.py class EnglishNumberNormalizer (line 12) | class EnglishNumberNormalizer: method __init__ (line 23) | def __init__(self): method process_words (line 165) | def process_words(self, words: List[str]) -> Iterator[str]: method preprocess (line 388) | def preprocess(self, s: str): method postprocess (line 417) | def postprocess(self, s: str): method __call__ (line 442) | def __call__(self, s: str): class EnglishSpellingNormalizer (line 450) | class EnglishSpellingNormalizer: method __init__ (line 457) | def __init__(self): method __call__ (line 461) | def __call__(self, s: str): class EnglishTextNormalizer (line 465) | class EnglishTextNormalizer: method __init__ (line 466) | def __init__(self): method __call__ (line 526) | def __call__(self, s: str): FILE: xinference/thirdparty/whisper/timing.py function median_filter (line 19) | def median_filter(x: torch.Tensor, filter_width: int): function backtrace (line 58) | def backtrace(trace: np.ndarray): function dtw_cpu (line 83) | def dtw_cpu(x: np.ndarray): function dtw_cuda (line 108) | def dtw_cuda(x, BLOCK_SIZE=1024): function dtw (line 141) | def dtw(x: torch.Tensor) -> np.ndarray: class WordTiming (line 155) | class WordTiming: function find_alignment (line 163) | def find_alignment( function merge_punctuations (line 243) | def merge_punctuations(alignment: List[WordTiming], prepended: str, appe... function add_word_timestamps (line 277) | def add_word_timestamps( FILE: xinference/thirdparty/whisper/tokenizer.py class Tokenizer (line 132) | class Tokenizer: method __post_init__ (line 142) | def __post_init__(self): method encode (line 161) | def encode(self, text, **kwargs): method decode (line 164) | def decode(self, token_ids: List[int], **kwargs) -> str: method decode_with_timestamps (line 168) | def decode_with_timestamps(self, token_ids: List[int], **kwargs) -> str: method eot (line 176) | def eot(self) -> int: method transcribe (line 180) | def transcribe(self) -> int: method translate (line 184) | def translate(self) -> int: method sot (line 188) | def sot(self) -> int: method sot_lm (line 192) | def sot_lm(self) -> int: method sot_prev (line 196) | def sot_prev(self) -> int: method no_speech (line 200) | def no_speech(self) -> int: method no_timestamps (line 204) | def no_timestamps(self) -> int: method timestamp_begin (line 208) | def timestamp_begin(self) -> int: method language_token (line 212) | def language_token(self) -> int: method to_language_token (line 219) | def to_language_token(self, language): method all_language_tokens (line 226) | def all_language_tokens(self) -> Tuple[int]: method all_language_codes (line 234) | def all_language_codes(self) -> Tuple[str]: method sot_sequence_including_notimestamps (line 238) | def sot_sequence_including_notimestamps(self) -> Tuple[int]: method non_speech_tokens (line 242) | def non_speech_tokens(self) -> Tuple[int]: method split_to_word_tokens (line 277) | def split_to_word_tokens(self, tokens: List[int]): method split_tokens_on_unicode (line 286) | def split_tokens_on_unicode(self, tokens: List[int]): method split_tokens_on_spaces (line 311) | def split_tokens_on_spaces(self, tokens: List[int]): function get_encoding (line 331) | def get_encoding(name: str = "gpt2", num_languages: int = 99): function get_tokenizer (line 367) | def get_tokenizer( FILE: xinference/thirdparty/whisper/transcribe.py function transcribe (line 38) | def transcribe( function cli (line 501) | def cli(): FILE: xinference/thirdparty/whisper/triton_ops.py function dtw_kernel (line 14) | def dtw_kernel( function median_kernel (line 44) | def median_kernel(filter_width: int): function median_filter_cuda (line 98) | def median_filter_cuda(x: torch.Tensor, filter_width: int): FILE: xinference/thirdparty/whisper/utils.py function make_safe (line 12) | def make_safe(string): function make_safe (line 19) | def make_safe(string): function exact_div (line 24) | def exact_div(x, y): function str2bool (line 29) | def str2bool(string): function optional_int (line 37) | def optional_int(string): function optional_float (line 41) | def optional_float(string): function compression_ratio (line 45) | def compression_ratio(text) -> float: function format_timestamp (line 50) | def format_timestamp( function get_start (line 71) | def get_start(segments: List[dict]) -> Optional[float]: function get_end (line 78) | def get_end(segments: List[dict]) -> Optional[float]: class ResultWriter (line 85) | class ResultWriter: method __init__ (line 88) | def __init__(self, output_dir: str): method __call__ (line 91) | def __call__( method write_result (line 103) | def write_result( class WriteTXT (line 109) | class WriteTXT(ResultWriter): method write_result (line 112) | def write_result( class SubtitlesWriter (line 119) | class SubtitlesWriter(ResultWriter): method iterate_result (line 123) | def iterate_result( method format_timestamp (line 228) | def format_timestamp(self, seconds: float): class WriteVTT (line 236) | class WriteVTT(SubtitlesWriter): method write_result (line 241) | def write_result( class WriteSRT (line 249) | class WriteSRT(SubtitlesWriter): method write_result (line 254) | def write_result( class WriteTSV (line 263) | class WriteTSV(ResultWriter): method write_result (line 275) | def write_result( class WriteJSON (line 285) | class WriteJSON(ResultWriter): method write_result (line 288) | def write_result( function get_writer (line 294) | def get_writer( FILE: xinference/types.py class Image (line 40) | class Image(TypedDict): class ImageList (line 45) | class ImageList(TypedDict): class ImageEditRequest (line 50) | class ImageEditRequest(TypedDict, total=False): class SDAPIResult (line 59) | class SDAPIResult(TypedDict): class Video (line 65) | class Video(TypedDict): class VideoList (line 70) | class VideoList(TypedDict): class EmbeddingUsage (line 75) | class EmbeddingUsage(TypedDict): class EmbeddingData (line 80) | class EmbeddingData(TypedDict): class Embedding (line 87) | class Embedding(TypedDict): class Document (line 95) | class Document(TypedDict): class DocumentObj (line 99) | class DocumentObj(TypedDict): class ApiVersion (line 106) | class ApiVersion(TypedDict): class BilledUnit (line 113) | class BilledUnit(TypedDict): class RerankTokens (line 120) | class RerankTokens(TypedDict): class Meta (line 125) | class Meta(TypedDict): class Rerank (line 132) | class Rerank(TypedDict): class CompletionLogprobs (line 138) | class CompletionLogprobs(TypedDict): class ToolCallFunction (line 145) | class ToolCallFunction(TypedDict): class ToolCalls (line 150) | class ToolCalls(TypedDict): class CompletionChoice (line 156) | class CompletionChoice(TypedDict): class CompletionUsage (line 164) | class CompletionUsage(TypedDict): class CompletionChunk (line 170) | class CompletionChunk(TypedDict): class Completion (line 179) | class Completion(TypedDict): class ChatCompletionAudio (line 188) | class ChatCompletionAudio(TypedDict): class ChatCompletionMessage (line 195) | class ChatCompletionMessage(TypedDict): class ChatCompletionChoice (line 204) | class ChatCompletionChoice(TypedDict): class ChatCompletion (line 210) | class ChatCompletion(TypedDict): class ChatCompletionChunkDelta (line 219) | class ChatCompletionChunkDelta(TypedDict): class ChatCompletionChunkChoice (line 226) | class ChatCompletionChunkChoice(TypedDict): class ChatCompletionChunk (line 232) | class ChatCompletionChunk(TypedDict): class StoppingCriteriaList (line 244) | class StoppingCriteriaList(List[StoppingCriteria]): method __call__ (line 245) | def __call__(self, input_ids: List[int], logits: List[float]) -> bool: class LogitsProcessorList (line 252) | class LogitsProcessorList(List[LogitsProcessor]): method __call__ (line 253) | def __call__(self, input_ids: List[int], scores: List[float]) -> List[... class PytorchGenerateConfig (line 259) | class PytorchGenerateConfig(TypedDict, total=False): class CogagentGenerateConfig (line 277) | class CogagentGenerateConfig(PytorchGenerateConfig, total=False): class PytorchModelConfig (line 290) | class PytorchModelConfig(TypedDict, total=False): function get_pydantic_model_from_method (line 312) | def get_pydantic_model_from_method( function fix_forward_ref (line 338) | def fix_forward_ref(model): class ModelAndPrompt (line 358) | class ModelAndPrompt(BaseModel): class ModelAndMessages (line 363) | class ModelAndMessages(BaseModel): class CreateCompletionTorch (line 368) | class CreateCompletionTorch(BaseModel): class CreateCompletion (line 396) | class CreateCompletion( class CreateChatModel (line 404) | class CreateChatModel(BaseModel): class CreateChatCompletion (line 414) | class CreateChatCompletion( # type: ignore class LoRA (line 422) | class LoRA: method __init__ (line 423) | def __init__(self, lora_name: str, local_path: str): method to_dict (line 427) | def to_dict(self): method from_dict (line 434) | def from_dict(cls, data: Dict): class PeftModelConfig (line 441) | class PeftModelConfig: method __init__ (line 442) | def __init__( method to_dict (line 452) | def to_dict(self): method from_dict (line 464) | def from_dict(cls, data: Dict): class AnthropicMessage (line 498) | class AnthropicMessage(TypedDict): class MessageCreateParams (line 509) | class MessageCreateParams(TypedDict): class CreateMessage (line 524) | class CreateMessage( class AnthropicMessage (line 533) | class AnthropicMessage(TypedDict): class MessageCreateParams (line 544) | class MessageCreateParams(TypedDict): class CreateMessage (line 562) | class CreateMessage(CreateMessageAnthropic): class AnthropicMessage (line 567) | class AnthropicMessage: class MessageCreateParams (line 570) | class MessageCreateParams: class CreateMessage (line 575) | class CreateMessage: FILE: xinference/ui/gradio/chat_interface.py class GradioInterface (line 37) | class GradioInterface: method __init__ (line 38) | def __init__( method build (line 68) | def build(self) -> "gr.Blocks": method build_chat_interface (line 96) | def build_chat_interface(self) -> "gr.Blocks": method build_chat_multimodel_interface (line 333) | def build_chat_multimodel_interface( method build_generate_interface (line 635) | def build_generate_interface( FILE: xinference/ui/gradio/media_interface.py class MediaInterface (line 38) | class MediaInterface: method __init__ (line 39) | def __init__( method build (line 65) | def build(self) -> gr.Blocks: method text2image_interface (line 88) | def text2image_interface(self) -> "gr.Blocks": method image2image_interface (line 212) | def image2image_interface(self) -> "gr.Blocks": method inpainting_interface (line 423) | def inpainting_interface(self) -> "gr.Blocks": method text2video_interface (line 721) | def text2video_interface(self) -> "gr.Blocks": method image2video_interface (line 834) | def image2video_interface(self) -> "gr.Blocks": method flf2video_interface (line 950) | def flf2video_interface(self) -> "gr.Blocks": method audio2text_interface (line 1070) | def audio2text_interface(self) -> "gr.Blocks": method text2speech_interface (line 1126) | def text2speech_interface(self) -> "gr.Blocks": method ocr_interface (line 1234) | def ocr_interface(self) -> "gr.Blocks": method document_parsing_interface (line 1614) | def document_parsing_interface(self) -> "gr.Blocks": method build_main_interface (line 1778) | def build_main_interface(self) -> "gr.Blocks": FILE: xinference/ui/gradio/utils/latex.py function process_latex_formulas (line 27) | def process_latex_formulas(text: str, output_format: str = "markdown") -... function clean_latex_syntax (line 121) | def clean_latex_syntax(text: str) -> str: function process_ocr_latex (line 197) | def process_ocr_latex(text: str, output_format: str = "markdown") -> str: function contains_latex (line 223) | def contains_latex(text: str) -> bool: function process_ocr_result_with_latex (line 254) | def process_ocr_result_with_latex( FILE: xinference/ui/web/ui/src/App.js function App (line 14) | function App() { FILE: xinference/ui/web/ui/src/components/authAlertDialog.js function AuthAlertDialog (line 14) | function AuthAlertDialog() { FILE: xinference/ui/web/ui/src/components/fetcher.js function fetcher (line 19) | function fetcher(url, options) { FILE: xinference/ui/web/ui/src/components/tableTitle.js function TableTitle (line 5) | function TableTitle(props) { FILE: xinference/ui/web/ui/src/components/themeContext.js function useThemeContext (line 8) | function useThemeContext() { FILE: xinference/ui/web/ui/src/components/titleTypography.js function TitleTypography (line 10) | function TitleTypography({ value }) { FILE: xinference/ui/web/ui/src/components/utils.js function copyToClipboard (line 23) | async function copyToClipboard(text) { FILE: xinference/ui/web/ui/src/scenes/cluster_info/nodeInfo.js class NodeInfo (line 13) | class NodeInfo extends React.Component { method constructor (line 14) | constructor(props) { method refreshInfo (line 25) | refreshInfo() { method componentDidMount (line 68) | componentDidMount() { method componentWillUnmount (line 73) | componentWillUnmount() { method render (line 77) | render() { FILE: xinference/ui/web/ui/src/scenes/launch_model/LaunchModel.js constant ENABLE_PAGINATION (line 29) | const ENABLE_PAGINATION = false function getUniqueModelAbilities (line 120) | function getUniqueModelAbilities(arr) { function getLabel (line 324) | function getLabel(item) { FILE: xinference/ui/web/ui/src/scenes/launch_model/components/modelFormConfig.js function getModelFormConfig (line 6) | function getModelFormConfig({ FILE: xinference/ui/web/ui/src/scenes/login/header.js function Header (line 7) | function Header() { FILE: xinference/ui/web/ui/src/scenes/login/login.js function Login (line 16) | function Login() { FILE: xinference/ui/web/ui/src/scenes/register_model/registerModel.js constant SUPPORTED_LANGUAGES_DICT (line 49) | const SUPPORTED_LANGUAGES_DICT = { en: 'English', zh: 'Chinese' } constant SUPPORTED_LANGUAGES (line 106) | const SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT) FILE: xinference/utils.py function cuda_count (line 21) | def cuda_count(): function get_real_path (line 28) | def get_real_path(path: str) -> Optional[str]: function get_pip_config_args (line 42) | def get_pip_config_args() -> dict[str, str | list[str]]: function make_hashable (line 86) | def make_hashable(obj):