repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/test_lockfile_repository.py | tests/repositories/test_lockfile_repository.py | from __future__ import annotations
from copy import deepcopy
import pytest
from poetry.core.packages.package import Package
from poetry.repositories.lockfile_repository import LockfileRepository
@pytest.fixture(scope="module")
def packages() -> list[Package]:
return [
Package("a", "1.0", source_type="... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/test_installed_repository.py | tests/repositories/test_installed_repository.py | from __future__ import annotations
import os
import shutil
import zipfile
from functools import cached_property
from importlib import metadata
from pathlib import Path
from typing import TYPE_CHECKING
from typing import NamedTuple
import pytest
from poetry.repositories.installed_repository import InstalledRepositor... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/test_pypi_repository.py | tests/repositories/test_pypi_repository.py | from __future__ import annotations
from io import BytesIO
from typing import TYPE_CHECKING
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
from poetry.core.packages.dependency import Dependency
from requests.exceptions import TooManyRedirects
from reque... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/test_http_repository.py | tests/repositories/test_http_repository.py | from __future__ import annotations
import contextlib
import shutil
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from zipfile import ZipFile
import pytest
from packaging.metadata import parse_email
from poetry.core.packages.utils.link import Link
from poetry.inspection.info impor... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/test_single_page_repository.py | tests/repositories/test_single_page_repository.py | from __future__ import annotations
import re
from pathlib import Path
from typing import TYPE_CHECKING
from poetry.core.packages.dependency import Dependency
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.repositories.link_sources.html import HTMLPage
from poetry.repositories.single_pag... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/test_repository.py | tests/repositories/test_repository.py | from __future__ import annotations
import pytest
from poetry.core.constraints.version import Version
from poetry.factory import Factory
from poetry.repositories import Repository
from tests.helpers import get_package
@pytest.fixture(scope="module")
def repository() -> Repository:
repo = Repository("repo")
... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/fixtures/pypi.py | tests/repositories/fixtures/pypi.py | from __future__ import annotations
import re
from typing import TYPE_CHECKING
from urllib.parse import urlparse
import pytest
import responses
from poetry.repositories.pypi_repository import PyPiRepository
from tests.helpers import FIXTURE_PATH_DISTRIBUTIONS
from tests.helpers import FIXTURE_PATH_REPOSITORIES_PYPI
... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/fixtures/python_hosted.py | tests/repositories/fixtures/python_hosted.py | from __future__ import annotations
import re
from collections.abc import Iterator
from pathlib import Path
from typing import TYPE_CHECKING
from urllib.parse import urlparse
import pytest
import responses
if TYPE_CHECKING:
from collections.abc import Iterator
from requests import PreparedRequest
from... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/fixtures/legacy.py | tests/repositories/fixtures/legacy.py | from __future__ import annotations
import json
import re
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from urllib.parse import urlparse
import pytest
import responses
from packaging.utils import canonicalize_name
from poetry.repositories.legacy_repository import LegacyRepository... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/fixtures/__init__.py | tests/repositories/fixtures/__init__.py | from __future__ import annotations
pytest_plugins = [
"tests.repositories.fixtures.distribution_hashes",
"tests.repositories.fixtures.legacy",
"tests.repositories.fixtures.pypi",
"tests.repositories.fixtures.python_hosted",
]
| python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/fixtures/distribution_hashes.py | tests/repositories/fixtures/distribution_hashes.py | # this file is generated by tests/repositories/fixtures/pypi.org/generate.py
from __future__ import annotations
import dataclasses
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from tests.types import DistributionHashGetter
@dataclasses.dataclass
class DistributionHash:
sha256: str = "... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/fixtures/pypi.org/generate.py | tests/repositories/fixtures/pypi.org/generate.py | """
This is a helper script built to generate mocked PyPI json files and release files. Executing the script does the
following for a specified list of releases.
1. Fetch relevant project json file from https://pypi.org/simple/<name>.
2. Fetch relevant release json file from https://pypi.org/pypi/<name>/<version>/json... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/link_sources/test_html.py | tests/repositories/link_sources/test_html.py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
from poetry.core.packages.utils.link import Link
from poetry.repositories.link_sources.html import HTMLPage
from poetry.repositories.lin... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/link_sources/test_json.py | tests/repositories/link_sources/test_json.py | from __future__ import annotations
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version.version import Version
from poetry.repositories.link_sources.json import SimpleJsonPage
from poetry.repositories.link_sources.json import SimpleRepositoryJsonRootPage
@pytest.fixture
... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/link_sources/test_base.py | tests/repositories/link_sources/test_base.py | from __future__ import annotations
from collections import defaultdict
from functools import cached_property
from typing import TYPE_CHECKING
from unittest.mock import PropertyMock
import pytest
from packaging.utils import canonicalize_name
from poetry.core.constraints.version import Version
from poetry.core.package... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/link_sources/__init__.py | tests/repositories/link_sources/__init__.py | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false | |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/parsers/__init__.py | tests/repositories/parsers/__init__.py | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false | |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/parsers/test_html_page_parser.py | tests/repositories/parsers/test_html_page_parser.py | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.repositories.parsers.html_page_parser import HTMLPageParser
if TYPE_CHECKING:
from tests.types import HTMLPageGetter
@pytest.fixture()
def html_page(html_page_content: HTMLPageGetter) -> str:
links = """
... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/repositories/parsers/test_pypi_search_parser.py | tests/repositories/parsers/test_pypi_search_parser.py | from __future__ import annotations
from pathlib import Path
import pytest
from poetry.repositories.parsers.pypi_search_parser import Result
from poetry.repositories.parsers.pypi_search_parser import SearchResultParser
FIXTURES_DIRECTORY = Path(__file__).parent.parent / "fixtures" / "pypi.org" / "search"
@pytest.... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/packages/test_transitive_package_info.py | tests/packages/test_transitive_package_info.py | from __future__ import annotations
import pytest
from packaging.utils import canonicalize_name
from poetry.core.packages.dependency_group import MAIN_GROUP
from poetry.core.version.markers import parse_marker
from poetry.packages.transitive_package_info import TransitivePackageInfo
DEV_GROUP = canonicalize_name("d... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/packages/test_direct_origin.py | tests/packages/test_direct_origin.py | from __future__ import annotations
from typing import TYPE_CHECKING
from unittest.mock import MagicMock
from poetry.core.packages.utils.link import Link
from poetry.packages.direct_origin import DirectOrigin
from poetry.utils.cache import ArtifactCache
if TYPE_CHECKING:
from pathlib import Path
from pytes... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/packages/test_locker.py | tests/packages/test_locker.py | from __future__ import annotations
import json
import logging
import os
import re
import sys
import tempfile
import uuid
from hashlib import sha256
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import Literal
import pytest
from packaging.utils import canonicalize_name
... | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | true |
python-poetry/poetry | https://github.com/python-poetry/poetry/blob/5e1fd5e6cb391beb2b3292b28680461408760ae1/tests/packages/__init__.py | tests/packages/__init__.py | python | MIT | 5e1fd5e6cb391beb2b3292b28680461408760ae1 | 2026-01-04T14:42:33.943988Z | false | |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer-web.py | infer-web.py | import os
import sys
from dotenv import load_dotenv
now_dir = os.getcwd()
sys.path.append(now_dir)
load_dotenv()
from infer.modules.vc.modules import VC
from infer.modules.uvr5.modules import uvr
from infer.lib.train.process_ckpt import (
change_info,
extract_small_model,
merge,
show_info,
)
from i18n.... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | true |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/api_231006.py | api_231006.py | #api for 231006 release version by Xiaokai
import os
import sys
import json
import re
import time
import librosa
import torch
import numpy as np
import torch.nn.functional as F
import torchaudio.transforms as tat
import sounddevice as sd
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException
from pyd... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/gui_v1.py | gui_v1.py | import os
import sys
from dotenv import load_dotenv
import shutil
load_dotenv()
os.environ["OMP_NUM_THREADS"] = "4"
if sys.platform == "darwin":
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
now_dir = os.getcwd()
sys.path.append(now_dir)
import multiprocessing
flag_vc = False
def printt(strr, *args):
if... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | true |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/api_240604.py | api_240604.py | #api for 240604 release version by Xiaokai
import os
import sys
import json
import re
import time
import librosa
import torch
import numpy as np
import torch.nn.functional as F
import torchaudio.transforms as tat
import sounddevice as sd
from dotenv import load_dotenv
from fastapi import FastAPI, HTTPException
from pyd... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/rvc_for_realtime.py | tools/rvc_for_realtime.py | from io import BytesIO
import os
import pickle
import sys
import traceback
from infer.lib import jit
from infer.lib.jit.get_synthesizer import get_synthesizer
from time import time as ttime
import fairseq
import faiss
import numpy as np
import parselmouth
import pyworld
import scipy.signal as signal
import torch
import... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/download_models.py | tools/download_models.py | import os
from pathlib import Path
import requests
RVC_DOWNLOAD_LINK = "https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/"
BASE_DIR = Path(__file__).resolve().parent.parent
def dl_model(link, model_name, dir_name):
with requests.get(f"{link}{model_name}") as r:
r.raise_for_status()
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/infer_batch_rvc.py | tools/infer_batch_rvc.py | import argparse
import os
import sys
print("Command-line arguments:", sys.argv)
now_dir = os.getcwd()
sys.path.append(now_dir)
import sys
import tqdm as tq
from dotenv import load_dotenv
from scipy.io import wavfile
from configs.config import Config
from infer.modules.vc.modules import VC
def arg_parse() -> tuple... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/export_onnx.py | tools/export_onnx.py | import torch
from infer.lib.infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
if __name__ == "__main__":
MoeVS = True # 模型是否为MoeVoiceStudio(原MoeSS)使用
ModelPath = "Shiroha/shiroha.pth" # 模型路径
ExportedPath = "model.onnx" # 输出路径
hidden_channels = 256 # hidden_channels,为768Vec做准备
cpt = torch.l... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/calc_rvc_model_similarity.py | tools/calc_rvc_model_similarity.py | # This code references https://huggingface.co/JosephusCheung/ASimilarityCalculatior/blob/main/qwerty.py
# Fill in the path of the model to be queried and the root directory of the reference models, and this script will return the similarity between the model to be queried and all reference models.
import os
import logg... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/infer_cli.py | tools/infer_cli.py | import argparse
import os
import sys
now_dir = os.getcwd()
sys.path.append(now_dir)
from dotenv import load_dotenv
from scipy.io import wavfile
from configs.config import Config
from infer.modules.vc.modules import VC
####
# USAGE
#
# In your Terminal or CMD or whatever
def arg_parse() -> tuple:
parser = argpa... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/onnx_inference_demo.py | tools/onnx_inference_demo.py | import soundfile
from ..infer.lib.infer_pack.onnx_inference import OnnxRVC
hop_size = 512
sampling_rate = 40000 # 采样率
f0_up_key = 0 # 升降调
sid = 0 # 角色ID
f0_method = "dio" # F0提取算法
model_path = "ShirohaRVC.onnx" # 模型的完整路径
vec_name = (
"vec-256-layer-9" # 内部自动补齐为 f"pretrained/{vec_name}.onnx" 需要onnx的vec模型
)
w... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/app.py | tools/app.py | import logging
import os
# os.system("wget -P cvec/ https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt")
import gradio as gr
from dotenv import load_dotenv
from configs.config import Config
from i18n.i18n import I18nAuto
from infer.modules.vc.modules import VC
logging.getLogger("numba").s... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/infer/train-index.py | tools/infer/train-index.py | """
格式:直接cid为自带的index位;aid放不下了,通过字典来查,反正就5w个
"""
import os
import logging
logger = logging.getLogger(__name__)
import faiss
import numpy as np
# ###########如果是原始特征要先写save
inp_root = r"E:\codes\py39\dataset\mi\2-co256"
npys = []
for name in sorted(list(os.listdir(inp_root))):
phone = np.load("%s/%s" % (inp_root,... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/infer/train-index-v2.py | tools/infer/train-index-v2.py | """
格式:直接cid为自带的index位;aid放不下了,通过字典来查,反正就5w个
"""
import os
import traceback
import logging
logger = logging.getLogger(__name__)
from multiprocessing import cpu_count
import faiss
import numpy as np
from sklearn.cluster import MiniBatchKMeans
# ###########如果是原始特征要先写save
n_cpu = 0
if n_cpu == 0:
n_cpu = cpu_coun... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/infer/infer-pm-index256.py | tools/infer/infer-pm-index256.py | """
对源特征进行检索
"""
import os
import logging
logger = logging.getLogger(__name__)
import parselmouth
import torch
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# import torchcrepe
from time import time as ttime
# import pyworld
import librosa
import numpy as np
import soundfile as sf
import torch.nn.functional as F
from ... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/infer/trans_weights.py | tools/infer/trans_weights.py | import pdb
import torch
# a=torch.load(r"E:\codes\py39\vits_vc_gpu_train\logs\ft-mi-suc\G_1000.pth")["model"]#sim_nsf#
# a=torch.load(r"E:\codes\py39\vits_vc_gpu_train\logs\ft-mi-freeze-vocoder-flow-enc_q\G_1000.pth")["model"]#sim_nsf#
# a=torch.load(r"E:\codes\py39\vits_vc_gpu_train\logs\ft-mi-freeze-vocoder\G_1000.... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/torchgate/torchgate.py | tools/torchgate/torchgate.py | import torch
from infer.lib.rmvpe import STFT
from torch.nn.functional import conv1d, conv2d
from typing import Union, Optional
from .utils import linspace, temperature_sigmoid, amp_to_db
class TorchGate(torch.nn.Module):
"""
A PyTorch module that applies a spectral gate to an input signal.
Arguments:
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/torchgate/utils.py | tools/torchgate/utils.py | import torch
from torch.types import Number
@torch.no_grad()
def amp_to_db(
x: torch.Tensor, eps=torch.finfo(torch.float64).eps, top_db=40
) -> torch.Tensor:
"""
Convert the input tensor from amplitude to decibel scale.
Arguments:
x {[torch.Tensor]} -- [Input tensor.]
Keyword Arguments:
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/tools/torchgate/__init__.py | tools/torchgate/__init__.py | """
TorchGating is a PyTorch-based implementation of Spectral Gating
================================================
Author: Asaf Zorea
Contents
--------
torchgate imports all the functions from PyTorch, and in addition provides:
TorchGating --- A PyTorch module that applies a spectral gate to an input signal
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/i18n/scan_i18n.py | i18n/scan_i18n.py | import ast
import glob
import json
from collections import OrderedDict
def extract_i18n_strings(node):
i18n_strings = []
if (
isinstance(node, ast.Call)
and isinstance(node.func, ast.Name)
and node.func.id == "i18n"
):
for arg in node.args:
if isinstance(arg, a... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/i18n/locale_diff.py | i18n/locale_diff.py | import json
import os
from collections import OrderedDict
# Define the standard file name
standard_file = "locale/zh_CN.json"
# Find all JSON files in the directory
dir_path = "locale/"
languages = [
os.path.join(dir_path, f)
for f in os.listdir(dir_path)
if f.endswith(".json") and f != standard_file
]
#... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/i18n/i18n.py | i18n/i18n.py | import json
import locale
import os
def load_language_list(language):
with open(f"./i18n/locale/{language}.json", "r", encoding="utf-8") as f:
language_list = json.load(f)
return language_list
class I18nAuto:
def __init__(self, language=None):
if language in ["Auto", None]:
l... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/train/train.py | infer/modules/train/train.py | import os
import sys
import logging
logger = logging.getLogger(__name__)
now_dir = os.getcwd()
sys.path.append(os.path.join(now_dir))
import datetime
from infer.lib.train import utils
hps = utils.get_hparams()
os.environ["CUDA_VISIBLE_DEVICES"] = hps.gpus.replace("-", ",")
n_gpus = len(hps.gpus.split("-"))
from ra... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/train/preprocess.py | infer/modules/train/preprocess.py | import multiprocessing
import os
import sys
from scipy import signal
now_dir = os.getcwd()
sys.path.append(now_dir)
print(*sys.argv[1:])
inp_root = sys.argv[1]
sr = int(sys.argv[2])
n_p = int(sys.argv[3])
exp_dir = sys.argv[4]
noparallel = sys.argv[5] == "True"
per = float(sys.argv[6])
import os
import traceback
imp... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/train/extract_feature_print.py | infer/modules/train/extract_feature_print.py | import os
import sys
import traceback
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
os.environ["PYTORCH_MPS_HIGH_WATERMARK_RATIO"] = "0.0"
device = sys.argv[1]
n_part = int(sys.argv[2])
i_part = int(sys.argv[3])
if len(sys.argv) == 7:
exp_dir = sys.argv[4]
version = sys.argv[5]
is_half = sys.argv[6].low... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/train/extract/extract_f0_print.py | infer/modules/train/extract/extract_f0_print.py | import os
import sys
import traceback
import parselmouth
now_dir = os.getcwd()
sys.path.append(now_dir)
import logging
import numpy as np
import pyworld
from infer.lib.audio import load_audio
logging.getLogger("numba").setLevel(logging.WARNING)
from multiprocessing import Process
exp_dir = sys.argv[1]
f = open("%... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/train/extract/extract_f0_rmvpe.py | infer/modules/train/extract/extract_f0_rmvpe.py | import os
import sys
import traceback
import parselmouth
now_dir = os.getcwd()
sys.path.append(now_dir)
import logging
import numpy as np
import pyworld
from infer.lib.audio import load_audio
logging.getLogger("numba").setLevel(logging.WARNING)
n_part = int(sys.argv[1])
i_part = int(sys.argv[2])
i_gpu = sys.argv[... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/train/extract/extract_f0_rmvpe_dml.py | infer/modules/train/extract/extract_f0_rmvpe_dml.py | import os
import sys
import traceback
import parselmouth
now_dir = os.getcwd()
sys.path.append(now_dir)
import logging
import numpy as np
import pyworld
from infer.lib.audio import load_audio
logging.getLogger("numba").setLevel(logging.WARNING)
exp_dir = sys.argv[1]
import torch_directml
device = torch_directml.... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/vc/modules.py | infer/modules/vc/modules.py | import traceback
import logging
logger = logging.getLogger(__name__)
import numpy as np
import soundfile as sf
import torch
from io import BytesIO
from infer.lib.audio import load_audio, wav2
from infer.lib.infer_pack.models import (
SynthesizerTrnMs256NSFsid,
SynthesizerTrnMs256NSFsid_nono,
SynthesizerT... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/vc/utils.py | infer/modules/vc/utils.py | import os
from fairseq import checkpoint_utils
def get_index_path_from_model(sid):
return next(
(
f
for f in [
os.path.join(root, name)
for root, _, files in os.walk(os.getenv("index_root"), topdown=False)
for name in files
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/vc/pipeline.py | infer/modules/vc/pipeline.py | import os
import sys
import traceback
import logging
logger = logging.getLogger(__name__)
from functools import lru_cache
from time import time as ttime
import faiss
import librosa
import numpy as np
import parselmouth
import pyworld
import torch
import torch.nn.functional as F
import torchcrepe
from scipy import si... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/vc/__init__.py | infer/modules/vc/__init__.py | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false | |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/onnx/export.py | infer/modules/onnx/export.py | import torch
import onnxsim
import onnx
from infer.lib.infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
def export_onnx(ModelPath, ExportedPath):
cpt = torch.load(ModelPath, map_location="cpu")
cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0]
vec_channels = 256 if cpt.get("version", "v1") ==... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/ipex/gradscaler.py | infer/modules/ipex/gradscaler.py | from collections import defaultdict
import torch
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
import intel_extension_for_pytorch._C as core # pylint: disable=import-error, unused-import
# pylint: disable=protected-access, missing-function-docstring, line-too-long
OptState... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/ipex/__init__.py | infer/modules/ipex/__init__.py | import os
import sys
import contextlib
import torch
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
from .hijacks import ipex_hijacks
from .attention import attention_init
# pylint: disable=protected-access, missing-function-docstring, line-too-long
def ipex_init(): # pylin... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/ipex/attention.py | infer/modules/ipex/attention.py | import torch
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
# pylint: disable=protected-access, missing-function-docstring, line-too-long
original_torch_bmm = torch.bmm
def torch_bmm(input, mat2, *, out=None):
if input.dtype != mat2.dtype:
mat2 = mat2.to(input.... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/ipex/hijacks.py | infer/modules/ipex/hijacks.py | import contextlib
import importlib
import torch
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
# pylint: disable=protected-access, missing-function-docstring, line-too-long, unnecessary-lambda, no-else-return
class CondFunc: # pylint: disable=missing-class-docstring
de... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/uvr5/vr.py | infer/modules/uvr5/vr.py | import os
import logging
logger = logging.getLogger(__name__)
import librosa
import numpy as np
import soundfile as sf
import torch
from infer.lib.uvr5_pack.lib_v5 import nets_61968KB as Nets
from infer.lib.uvr5_pack.lib_v5 import spec_utils
from infer.lib.uvr5_pack.lib_v5.model_param_init import ModelParameters
fro... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/uvr5/modules.py | infer/modules/uvr5/modules.py | import os
import traceback
import logging
logger = logging.getLogger(__name__)
import ffmpeg
import torch
from configs.config import Config
from infer.modules.uvr5.mdxnet import MDXNetDereverb
from infer.modules.uvr5.vr import AudioPre, AudioPreDeEcho
config = Config()
def uvr(model_name, inp_root, save_root_voca... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/modules/uvr5/mdxnet.py | infer/modules/uvr5/mdxnet.py | import os
import logging
logger = logging.getLogger(__name__)
import librosa
import numpy as np
import soundfile as sf
import torch
from tqdm import tqdm
cpu = torch.device("cpu")
class ConvTDFNetTrim:
def __init__(
self, device, model_name, target_name, L, dim_f, dim_t, n_fft, hop=1024
):
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/rmvpe.py | infer/lib/rmvpe.py | from io import BytesIO
import os
from typing import List, Optional, Tuple
import numpy as np
import torch
from infer.lib import jit
try:
# Fix "Torch not compiled with CUDA enabled"
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
if torch.xpu.is_available():
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/audio.py | infer/lib/audio.py | import platform, os
import ffmpeg
import numpy as np
import av
from io import BytesIO
import traceback
import re
def wav2(i, o, format):
inp = av.open(i, "rb")
if format == "m4a":
format = "mp4"
out = av.open(o, "wb", format=format)
if format == "ogg":
format = "libvorbis"
if forma... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/slicer2.py | infer/lib/slicer2.py | import numpy as np
# This function is obtained from librosa.
def get_rms(
y,
frame_length=2048,
hop_length=512,
pad_mode="constant",
):
padding = (int(frame_length // 2), int(frame_length // 2))
y = np.pad(y, padding, mode=pad_mode)
axis = -1
# put our new within-frame axis at the end... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/rtrvc.py | infer/lib/rtrvc.py | from io import BytesIO
import os
import sys
import traceback
from infer.lib import jit
from infer.lib.jit.get_synthesizer import get_synthesizer
from time import time as ttime
import fairseq
import faiss
import numpy as np
import parselmouth
import pyworld
import scipy.signal as signal
import torch
import torch.nn as n... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/train/data_utils.py | infer/lib/train/data_utils.py | import os
import traceback
import logging
logger = logging.getLogger(__name__)
import numpy as np
import torch
import torch.utils.data
from infer.lib.train.mel_processing import spectrogram_torch
from infer.lib.train.utils import load_filepaths_and_text, load_wav_to_torch
class TextAudioLoaderMultiNSFsid(torch.uti... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/train/process_ckpt.py | infer/lib/train/process_ckpt.py | import os
import sys
import traceback
from collections import OrderedDict
import torch
from i18n.i18n import I18nAuto
i18n = I18nAuto()
def savee(ckpt, sr, if_f0, name, epoch, version, hps):
try:
opt = OrderedDict()
opt["weight"] = {}
for key in ckpt.keys():
if "enc_q" in ke... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/train/mel_processing.py | infer/lib/train/mel_processing.py | import torch
import torch.utils.data
from librosa.filters import mel as librosa_mel_fn
import logging
logger = logging.getLogger(__name__)
MAX_WAV_VALUE = 32768.0
def dynamic_range_compression_torch(x, C=1, clip_val=1e-5):
"""
PARAMS
------
C: compression factor
"""
return torch.log(torch.cl... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/train/utils.py | infer/lib/train/utils.py | import argparse
import glob
import json
import logging
import os
import subprocess
import sys
import shutil
import numpy as np
import torch
from scipy.io.wavfile import read
MATPLOTLIB_FLAG = False
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging
def load_checkpoint_d(checkpoint_path, c... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/train/losses.py | infer/lib/train/losses.py | import torch
def feature_loss(fmap_r, fmap_g):
loss = 0
for dr, dg in zip(fmap_r, fmap_g):
for rl, gl in zip(dr, dg):
rl = rl.float().detach()
gl = gl.float()
loss += torch.mean(torch.abs(rl - gl))
return loss * 2
def discriminator_loss(disc_real_outputs, dis... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/jit/get_rmvpe.py | infer/lib/jit/get_rmvpe.py | import torch
def get_rmvpe(model_path="assets/rmvpe/rmvpe.pt", device=torch.device("cpu")):
from infer.lib.rmvpe import E2E
model = E2E(4, 1, (2, 2))
ckpt = torch.load(model_path, map_location=device)
model.load_state_dict(ckpt)
model.eval()
model = model.to(device)
return model
| python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/jit/get_hubert.py | infer/lib/jit/get_hubert.py | import math
import random
from typing import Optional, Tuple
from fairseq.checkpoint_utils import load_model_ensemble_and_task
import numpy as np
import torch
import torch.nn.functional as F
# from fairseq.data.data_utils import compute_mask_indices
from fairseq.utils import index_put
# @torch.jit.script
def pad_to_... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/jit/__init__.py | infer/lib/jit/__init__.py | from io import BytesIO
import pickle
import time
import torch
from tqdm import tqdm
from collections import OrderedDict
def load_inputs(path, device, is_half=False):
parm = torch.load(path, map_location=torch.device("cpu"))
for key in parm.keys():
parm[key] = parm[key].to(device)
if is_half an... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/jit/get_synthesizer.py | infer/lib/jit/get_synthesizer.py | import torch
def get_synthesizer(pth_path, device=torch.device("cpu")):
from infer.lib.infer_pack.models import (
SynthesizerTrnMs256NSFsid,
SynthesizerTrnMs256NSFsid_nono,
SynthesizerTrnMs768NSFsid,
SynthesizerTrnMs768NSFsid_nono,
)
cpt = torch.load(pth_path, map_location... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/attentions.py | infer/lib/infer_pack/attentions.py | import copy
import math
from typing import Optional
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from infer.lib.infer_pack import commons, modules
from infer.lib.infer_pack.modules import LayerNorm
class Encoder(nn.Module):
def __init__(
self,
hidden_... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/attentions_onnx.py | infer/lib/infer_pack/attentions_onnx.py | ############################## Warning! ##############################
# #
# Onnx Export Not Support All Of Non-Torch Types #
# Include Python Built-in Types!!!!!!!!!!!!!!!!! #
# If You Want TO C... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/models.py | infer/lib/infer_pack/models.py | import math
import logging
from typing import Optional
logger = logging.getLogger(__name__)
import numpy as np
import torch
from torch import nn
from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
from torch.nn import functional as F
from torch.nn.utils import remove_weight_norm, spectral_norm, weight_nor... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | true |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/models_onnx.py | infer/lib/infer_pack/models_onnx.py | ############################## Warning! ##############################
# #
# Onnx Export Not Support All Of Non-Torch Types #
# Include Python Built-in Types!!!!!!!!!!!!!!!!! #
# If You Want TO C... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/modules.py | infer/lib/infer_pack/modules.py | import copy
import math
from typing import Optional, Tuple
import numpy as np
import scipy
import torch
from torch import nn
from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
from torch.nn import functional as F
from torch.nn.utils import remove_weight_norm, weight_norm
from infer.lib.infer_pack import ... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/onnx_inference.py | infer/lib/infer_pack/onnx_inference.py | import librosa
import numpy as np
import onnxruntime
import soundfile
import logging
logger = logging.getLogger(__name__)
class ContentVec:
def __init__(self, vec_path="pretrained/vec-768-layer-12.onnx", device=None):
logger.info("Load model(s) from {}".format(vec_path))
if device == "cpu" or de... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/commons.py | infer/lib/infer_pack/commons.py | from typing import List, Optional
import math
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
def init_weights(m, mean=0.0, std=0.01):
classname = m.__class__.__name__
if classname.find("Conv") != -1:
m.weight.data.normal_(mean, std)
def get_padding(kernel_... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/transforms.py | infer/lib/infer_pack/transforms.py | import numpy as np
import torch
from torch.nn import functional as F
DEFAULT_MIN_BIN_WIDTH = 1e-3
DEFAULT_MIN_BIN_HEIGHT = 1e-3
DEFAULT_MIN_DERIVATIVE = 1e-3
def piecewise_rational_quadratic_transform(
inputs,
unnormalized_widths,
unnormalized_heights,
unnormalized_derivatives,
inverse=False,
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/modules/F0Predictor/HarvestF0Predictor.py | infer/lib/infer_pack/modules/F0Predictor/HarvestF0Predictor.py | import numpy as np
import pyworld
from infer.lib.infer_pack.modules.F0Predictor.F0Predictor import F0Predictor
class HarvestF0Predictor(F0Predictor):
def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
self.hop_length = hop_length
self.f0_min = f0_min
self.f0_... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/modules/F0Predictor/DioF0Predictor.py | infer/lib/infer_pack/modules/F0Predictor/DioF0Predictor.py | import numpy as np
import pyworld
from infer.lib.infer_pack.modules.F0Predictor.F0Predictor import F0Predictor
class DioF0Predictor(F0Predictor):
def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
self.hop_length = hop_length
self.f0_min = f0_min
self.f0_max ... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/modules/F0Predictor/F0Predictor.py | infer/lib/infer_pack/modules/F0Predictor/F0Predictor.py | class F0Predictor(object):
def compute_f0(self, wav, p_len):
"""
input: wav:[signal_length]
p_len:int
output: f0:[signal_length//hop_length]
"""
pass
def compute_f0_uv(self, wav, p_len):
"""
input: wav:[signal_length]
p_len:i... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/modules/F0Predictor/__init__.py | infer/lib/infer_pack/modules/F0Predictor/__init__.py | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false | |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/infer_pack/modules/F0Predictor/PMF0Predictor.py | infer/lib/infer_pack/modules/F0Predictor/PMF0Predictor.py | import numpy as np
import parselmouth
from infer.lib.infer_pack.modules.F0Predictor.F0Predictor import F0Predictor
class PMF0Predictor(F0Predictor):
def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
self.hop_length = hop_length
self.f0_min = f0_min
self.f0_m... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/utils.py | infer/lib/uvr5_pack/utils.py | import json
import numpy as np
import torch
from tqdm import tqdm
def load_data(file_name: str = "./infer/lib/uvr5_pack/name_params.json") -> dict:
with open(file_name, "r") as f:
data = json.load(f)
return data
def make_padding(width, cropsize, offset):
left = offset
roi_size = cropsize -... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers_new.py | infer/lib/uvr5_pack/lib_v5/layers_new.py | import torch
import torch.nn.functional as F
from torch import nn
from . import spec_utils
class Conv2DBNActiv(nn.Module):
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
super(Conv2DBNActiv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers_123821KB.py | infer/lib/uvr5_pack/lib_v5/layers_123821KB.py | import torch
import torch.nn.functional as F
from torch import nn
from . import spec_utils
class Conv2DBNActiv(nn.Module):
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
super(Conv2DBNActiv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/spec_utils.py | infer/lib/uvr5_pack/lib_v5/spec_utils.py | import hashlib
import json
import math
import os
import librosa
import numpy as np
import soundfile as sf
from tqdm import tqdm
def crop_center(h1, h2):
h1_shape = h1.size()
h2_shape = h2.size()
if h1_shape[3] == h2_shape[3]:
return h1
elif h1_shape[3] < h2_shape[3]:
raise ValueError... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/model_param_init.py | infer/lib/uvr5_pack/lib_v5/model_param_init.py | import json
import os
import pathlib
default_param = {}
default_param["bins"] = 768
default_param["unstable_bins"] = 9 # training only
default_param["reduction_bins"] = 762 # training only
default_param["sr"] = 44100
default_param["pre_filter_start"] = 757
default_param["pre_filter_stop"] = 768
default_param["band"]... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_new.py | infer/lib/uvr5_pack/lib_v5/nets_new.py | import torch
import torch.nn.functional as F
from torch import nn
from . import layers_new
class BaseNet(nn.Module):
def __init__(
self, nin, nout, nin_lstm, nout_lstm, dilations=((4, 2), (8, 4), (12, 6))
):
super(BaseNet, self).__init__()
self.enc1 = layers_new.Conv2DBNActiv(nin, nou... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/dataset.py | infer/lib/uvr5_pack/lib_v5/dataset.py | import os
import random
import numpy as np
import torch
import torch.utils.data
from tqdm import tqdm
from . import spec_utils
class VocalRemoverValidationSet(torch.utils.data.Dataset):
def __init__(self, patch_list):
self.patch_list = patch_list
def __len__(self):
return len(self.patch_lis... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers_123812KB .py | infer/lib/uvr5_pack/lib_v5/layers_123812KB .py | import torch
import torch.nn.functional as F
from torch import nn
from . import spec_utils
class Conv2DBNActiv(nn.Module):
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
super(Conv2DBNActiv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_61968KB.py | infer/lib/uvr5_pack/lib_v5/nets_61968KB.py | import torch
import torch.nn.functional as F
from torch import nn
from . import layers_123821KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
self.enc2 = layers.En... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/layers_33966KB.py | infer/lib/uvr5_pack/lib_v5/layers_33966KB.py | import torch
import torch.nn.functional as F
from torch import nn
from . import spec_utils
class Conv2DBNActiv(nn.Module):
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
super(Conv2DBNActiv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(
... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
RVC-Project/Retrieval-based-Voice-Conversion-WebUI | https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7ef19867780cf703841ebafb565a4e47d1ea86ff/infer/lib/uvr5_pack/lib_v5/nets_537227KB.py | infer/lib/uvr5_pack/lib_v5/nets_537227KB.py | import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from . import layers_537238KB as layers
class BaseASPPNet(nn.Module):
def __init__(self, nin, ch, dilations=(4, 8, 16)):
super(BaseASPPNet, self).__init__()
self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
se... | python | MIT | 7ef19867780cf703841ebafb565a4e47d1ea86ff | 2026-01-04T14:42:38.476132Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.