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 |
|---|---|---|---|---|---|---|---|---|
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/patched_mha_with_cache_onnx.py | GPT_SoVITS/AR/modules/patched_mha_with_cache_onnx.py | from torch.nn.functional import *
from torch.nn.functional import (
_canonical_mask,
)
def multi_head_attention_forward_patched(
query,
key,
value,
embed_dim_to_check: int,
num_heads: int,
in_proj_weight,
in_proj_bias: Optional[Tensor],
bias_k: Optional[Tensor],
bias_v: Optiona... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/activation.py | GPT_SoVITS/AR/modules/activation.py | # modified from https://github.com/lifeiteng/vall-e/blob/main/valle/modules/activation.py
from typing import Optional, Tuple
import torch
from torch import Tensor
from torch.nn import Linear, Module
from torch.nn import functional as F
from torch.nn.init import constant_, xavier_normal_, xavier_uniform_
from torch.nn.... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/scaling.py | GPT_SoVITS/AR/modules/scaling.py | # Copyright 2022 Xiaomi Corp. (authors: Daniel Povey)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/optim.py | GPT_SoVITS/AR/modules/optim.py | # Copyright 2022 Xiaomi Corp. (authors: Daniel Povey)
#
# See ../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/transformer_onnx.py | GPT_SoVITS/AR/modules/transformer_onnx.py | # modified from https://github.com/lifeiteng/vall-e/blob/main/valle/modules/transformer.py
import copy
import numbers
from functools import partial
from typing import Any
from typing import Callable
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import torch
from ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/patched_mha_with_cache.py | GPT_SoVITS/AR/modules/patched_mha_with_cache.py | from torch.nn.functional import *
from torch.nn.functional import (
_mha_shape_check,
_canonical_mask,
_none_or_dtype,
_in_projection_packed,
)
import torch
# Tensor = torch.Tensor
# from typing import Callable, List, Optional, Tuple, Union
def multi_head_attention_forward_patched(
query,
key,... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/lr_schedulers.py | GPT_SoVITS/AR/modules/lr_schedulers.py | # modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/modules/lr_schedulers.py
# reference: https://github.com/lifeiteng/vall-e
import math
import torch
from matplotlib import pyplot as plt
from torch import nn
from torch.optim import Adam
class WarmupCosineLRSchedule(torch.optim.lr... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/embedding_onnx.py | GPT_SoVITS/AR/modules/embedding_onnx.py | # modified from https://github.com/lifeiteng/vall-e/blob/main/valle/modules/embedding.py
import math
import torch
from torch import nn
class TokenEmbedding(nn.Module):
def __init__(
self,
embedding_dim: int,
vocab_size: int,
dropout: float = 0.0,
):
super().__init__()
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/__init__.py | GPT_SoVITS/AR/modules/__init__.py | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false | |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/activation_onnx.py | GPT_SoVITS/AR/modules/activation_onnx.py | # modified from https://github.com/lifeiteng/vall-e/blob/main/valle/modules/activation.py
from typing import Optional, Tuple
import torch
from torch import Tensor
from torch.nn import Linear, Module
from torch.nn.init import constant_, xavier_normal_, xavier_uniform_
from torch.nn.modules.linear import NonDynamicallyQ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/embedding.py | GPT_SoVITS/AR/modules/embedding.py | # modified from https://github.com/lifeiteng/vall-e/blob/main/valle/modules/embedding.py
import math
import torch
from torch import nn
class TokenEmbedding(nn.Module):
def __init__(
self,
embedding_dim: int,
vocab_size: int,
dropout: float = 0.0,
):
super().__init__()
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/modules/transformer.py | GPT_SoVITS/AR/modules/transformer.py | # modified from https://github.com/lifeiteng/vall-e/blob/main/valle/modules/transformer.py
import copy
import numbers
from functools import partial
from typing import Any
from typing import Callable
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import torch
from ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/data/bucket_sampler.py | GPT_SoVITS/AR/data/bucket_sampler.py | # modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/data/bucket_sampler.py
# reference: https://github.com/lifeiteng/vall-e
import itertools
import math
import random
from random import shuffle
from typing import Iterator, Optional, TypeVar
import torch
import torch.distributed as d... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/data/dataset.py | GPT_SoVITS/AR/data/dataset.py | # modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/data/dataset.py
# reference: https://github.com/lifeiteng/vall-e
# sys.path.append("/data/docker/liujing04/gpt-vits/mq-vits-s1bert_no_bert")
import os
import traceback
from typing import Dict, List
import numpy as np
import pandas... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/data/data_module.py | GPT_SoVITS/AR/data/data_module.py | # modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/data/data_module.py
# reference: https://github.com/lifeiteng/vall-e
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader
from AR.data.bucket_sampler import DistributedBucketSampler
from AR.data... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/AR/data/__init__.py | GPT_SoVITS/AR/data/__init__.py | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false | |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py | GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py | import os
import sys
import threading
from tqdm import tqdm
now_dir = os.getcwd()
sys.path.append(now_dir)
import re
import torch
from text.LangSegmenter import LangSegmenter
from text import chinese
from typing import Dict, List, Tuple
from text.cleaner import clean_text
from text import cleaned_text_to_sequence
fr... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/TTS_infer_pack/text_segmentation_method.py | GPT_SoVITS/TTS_infer_pack/text_segmentation_method.py | import re
from typing import Callable
punctuation = set(["!", "?", "…", ",", ".", "-", " "])
METHODS = dict()
def get_method(name: str) -> Callable:
method = METHODS.get(name, None)
if method is None:
raise ValueError(f"Method {name} not found")
return method
def get_method_names() -> list:
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/TTS_infer_pack/TTS.py | GPT_SoVITS/TTS_infer_pack/TTS.py | import gc
import math
import os
import random
import sys
import time
import traceback
from copy import deepcopy
import torchaudio
from tqdm import tqdm
now_dir = os.getcwd()
sys.path.append(now_dir)
import os
from typing import List, Tuple, Union
import ffmpeg
import librosa
import numpy as np
import torch
import to... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | true |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/TTS_infer_pack/__init__.py | GPT_SoVITS/TTS_infer_pack/__init__.py | from . import TTS, text_segmentation_method
| python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/prepare_datasets/2-get-hubert-wav32k.py | GPT_SoVITS/prepare_datasets/2-get-hubert-wav32k.py | # -*- coding: utf-8 -*-
import sys
import os
inp_text = os.environ.get("inp_text")
inp_wav_dir = os.environ.get("inp_wav_dir")
exp_name = os.environ.get("exp_name")
i_part = os.environ.get("i_part")
all_parts = os.environ.get("all_parts")
if "_CUDA_VISIBLE_DEVICES" in os.environ:
os.environ["CUDA_VISIBLE_DEVICES"... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/prepare_datasets/2-get-sv.py | GPT_SoVITS/prepare_datasets/2-get-sv.py | # -*- coding: utf-8 -*-
import sys
import os
inp_text = os.environ.get("inp_text")
inp_wav_dir = os.environ.get("inp_wav_dir")
exp_name = os.environ.get("exp_name")
i_part = os.environ.get("i_part")
all_parts = os.environ.get("all_parts")
if "_CUDA_VISIBLE_DEVICES" in os.environ:
os.environ["CUDA_VISIBLE_DEVICES"... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/prepare_datasets/3-get-semantic.py | GPT_SoVITS/prepare_datasets/3-get-semantic.py | import os
inp_text = os.environ.get("inp_text")
exp_name = os.environ.get("exp_name")
i_part = os.environ.get("i_part")
all_parts = os.environ.get("all_parts")
if "_CUDA_VISIBLE_DEVICES" in os.environ:
os.environ["CUDA_VISIBLE_DEVICES"] = os.environ["_CUDA_VISIBLE_DEVICES"]
opt_dir = os.environ.get("opt_dir")
pret... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/prepare_datasets/1-get-text.py | GPT_SoVITS/prepare_datasets/1-get-text.py | # -*- coding: utf-8 -*-
import os
inp_text = os.environ.get("inp_text")
inp_wav_dir = os.environ.get("inp_wav_dir")
exp_name = os.environ.get("exp_name")
i_part = os.environ.get("i_part")
all_parts = os.environ.get("all_parts")
if "_CUDA_VISIBLE_DEVICES" in os.environ:
os.environ["CUDA_VISIBLE_DEVICES"] = os.envi... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/f5_tts/model/modules.py | GPT_SoVITS/f5_tts/model/modules.py | """
ein notation:
b - batch
n - sequence
nt - text sequence
nw - raw wave length
d - dimension
"""
from __future__ import annotations
import math
from typing import Optional
import torch
import torch.nn.functional as F
import torchaudio
from librosa.filters import mel as librosa_mel_fn
from torch import nn
from x_tr... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/f5_tts/model/__init__.py | GPT_SoVITS/f5_tts/model/__init__.py | # from f5_tts.model.cfm import CFM
#
# from f5_tts.model.backbones.unett import UNetT
from GPT_SoVITS.f5_tts.model.backbones.dit import DiT
# from f5_tts.model.backbones.dit import DiTNoCond
# from f5_tts.model.backbones.dit import DiTNoCondNoT
# from f5_tts.model.backbones.mmdit import MMDiT
# from f5_tts.model.train... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/f5_tts/model/backbones/mmdit.py | GPT_SoVITS/f5_tts/model/backbones/mmdit.py | """
ein notation:
b - batch
n - sequence
nt - text sequence
nw - raw wave length
d - dimension
"""
from __future__ import annotations
import torch
from torch import nn
from x_transformers.x_transformers import RotaryEmbedding
from f5_tts.model.modules import (
TimestepEmbedding,
ConvPositionEmbedding,
M... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/f5_tts/model/backbones/dit.py | GPT_SoVITS/f5_tts/model/backbones/dit.py | """
ein notation:
b - batch
n - sequence
nt - text sequence
nw - raw wave length
d - dimension
"""
from __future__ import annotations
import torch
from torch import nn
from torch.utils.checkpoint import checkpoint
from x_transformers.x_transformers import RotaryEmbedding
from GPT_SoVITS.f5_tts.model.modules import ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/f5_tts/model/backbones/unett.py | GPT_SoVITS/f5_tts/model/backbones/unett.py | """
ein notation:
b - batch
n - sequence
nt - text sequence
nw - raw wave length
d - dimension
"""
from __future__ import annotations
from typing import Literal
import torch
from torch import nn
import torch.nn.functional as F
from x_transformers import RMSNorm
from x_transformers.x_transformers import RotaryEmbeddi... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/data_utils.py | GPT_SoVITS/module/data_utils.py | import os
import random
import traceback
import torch
import torch.utils.data
from tqdm import tqdm
from module.mel_processing import spectrogram_torch, spec_to_mel_torch
from text import cleaned_text_to_sequence
import torch.nn.functional as F
from tools.my_utils import load_audio
version = os.environ.get("version",... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | true |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/attentions.py | GPT_SoVITS/module/attentions.py | import math
import torch
from torch import nn
from torch.nn import functional as F
from module import commons
from module.modules import LayerNorm
class Encoder(nn.Module):
def __init__(
self,
hidden_channels,
filter_channels,
n_heads,
n_layers,
kernel_size=1,
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/quantize.py | GPT_SoVITS/module/quantize.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Residual vector quantizer implementation."""
from dataclasses import dataclass, field
import typing as tp
import tor... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/distrib.py | GPT_SoVITS/module/distrib.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Torch distributed utilities."""
import typing as tp
import torch
def rank():
if torch.distributed.is_initializ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/attentions_onnx.py | GPT_SoVITS/module/attentions_onnx.py | import math
import torch
from torch import nn
from torch.nn import functional as F
from module import commons
from typing import Optional
class LayerNorm(nn.Module):
def __init__(self, channels, eps=1e-5):
super().__init__()
self.channels = channels
self.eps = eps
self.gamma = n... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/models.py | GPT_SoVITS/module/models.py | import warnings
warnings.filterwarnings("ignore")
import math
import torch
from torch import nn
from torch.nn import functional as F
from module import commons
from module import modules
from module import attentions
from f5_tts.model import DiT
from torch.nn import Conv1d, ConvTranspose1d, Conv2d
from torch.nn.util... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | true |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/ddp_utils.py | GPT_SoVITS/module/ddp_utils.py | import torch
from torch.nn.parallel import DistributedDataParallel
from torch.nn.parallel.distributed import _find_tensors
from packaging import version
# from https://github.com/Lightning-AI/lightning-bolts/blob/5d61197cd2f491f69e238137a5edabe80ae14ad9/pl_bolts/models/self_supervised/simclr/simclr_module.py#L20
clas... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/mel_processing.py | GPT_SoVITS/module/mel_processing.py | import torch
import torch.utils.data
from librosa.filters import mel as librosa_mel_fn
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.clamp(x, min=clip_val) * C)
def dynamic_range_decompr... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/models_onnx.py | GPT_SoVITS/module/models_onnx.py | import math
from typing import Optional
import torch
from torch import nn
from torch.nn import functional as F
from module import commons
from module import modules
from module import attentions_onnx as attentions
from f5_tts.model import DiT
from torch.nn import Conv1d, ConvTranspose1d, Conv2d
from torch.nn.utils i... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | true |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/modules.py | GPT_SoVITS/module/modules.py | import math
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn import Conv1d
from torch.nn.utils import weight_norm, remove_weight_norm
from module import commons
from module.commons import init_weights, get_padding
from module.transforms import piecewise_rational... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/core_vq.py | GPT_SoVITS/module/core_vq.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
# This implementation is inspired from
# https://github.com/lucidrains/vector-quantize-pytorch
# which is released under... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/commons.py | GPT_SoVITS/module/commons.py | import math
import torch
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_size, dilation=1):
return int((kernel_size * dilation - dilation) / 2)
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/losses.py | GPT_SoVITS/module/losses.py | import math
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... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/__init__.py | GPT_SoVITS/module/__init__.py | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false | |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/transforms.py | GPT_SoVITS/module/transforms.py | import torch
from torch.nn import functional as F
import numpy as np
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 | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/module/mrte_model.py | GPT_SoVITS/module/mrte_model.py | # This is Multi-reference timbre encoder
import torch
from torch import nn
from torch.nn.utils import remove_weight_norm, weight_norm
from module.attentions import MultiHeadAttention
class MRTE(nn.Module):
def __init__(
self,
content_enc_channels=192,
hidden_size=512,
out_channels... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/english.py | GPT_SoVITS/text/english.py | import pickle
import os
import re
import wordsegment
from g2p_en import G2p
from text.symbols import punctuation
from text.symbols2 import symbols
from builtins import str as unicode
from text.en_normalization.expend import normalize
from nltk.tokenize import TweetTokenizer
word_tokenize = TweetTokenizer().tokenize... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/symbols.py | GPT_SoVITS/text/symbols.py | # punctuation = ['!', '?', '…', ",", ".","@"]#@是SP停顿
punctuation = ["!", "?", "…", ",", "."] # @是SP停顿
punctuation.append("-")
pu_symbols = punctuation + ["SP", "SP2", "SP3", "UNK"]
# pu_symbols = punctuation + ["SP", 'SP2', 'SP3','SP4', "UNK"]
pad = "_"
c = [
"AA",
"EE",
"OO",
"b",
"c",
"ch",
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/korean.py | GPT_SoVITS/text/korean.py | # reference: https://github.com/ORI-Muchim/MB-iSTFT-VITS-Korean/blob/main/text/korean.py
import re
from jamo import h2j, j2hcj
import ko_pron
from g2pk2 import G2p
import importlib
import os
# 防止win下无法读取模型
if os.name == "nt":
class win_G2p(G2p):
def check_mecab(self):
super().check_mecab()
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/chinese.py | GPT_SoVITS/text/chinese.py | import os
import re
import cn2an
from pypinyin import lazy_pinyin, Style
from text.symbols import punctuation
from text.tone_sandhi import ToneSandhi
from text.zh_normalization.text_normlization import TextNormalizer
normalizer = lambda x: cn2an.transform(x, "an2cn")
current_file_path = os.path.dirname(__file__)
pi... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/cantonese.py | GPT_SoVITS/text/cantonese.py | # reference: https://huggingface.co/spaces/Naozumi0512/Bert-VITS2-Cantonese-Yue/blob/main/text/chinese.py
import re
import cn2an
import ToJyutping
from text.symbols import punctuation
from text.zh_normalization.text_normlization import TextNormalizer
normalizer = lambda x: cn2an.transform(x, "an2cn")
INITIALS = [
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/symbols2.py | GPT_SoVITS/text/symbols2.py | # punctuation = ['!', '?', '…', ",", ".","@"]#@是SP停顿
punctuation = ["!", "?", "…", ",", "."] # @是SP停顿
punctuation.append("-")
pu_symbols = punctuation + ["SP", "SP2", "SP3", "UNK"]
# pu_symbols = punctuation + ["SP", 'SP2', 'SP3','SP4', "UNK"]
pad = "_"
c = [
"AA",
"EE",
"OO",
"b",
"c",
"ch",
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/chinese2.py | GPT_SoVITS/text/chinese2.py | import os
import re
import cn2an
from pypinyin import lazy_pinyin, Style
from pypinyin.contrib.tone_convert import to_finals_tone3, to_initials
from text.symbols import punctuation
from text.tone_sandhi import ToneSandhi
from text.zh_normalization.text_normlization import TextNormalizer
normalizer = lambda x: cn2an.... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/tone_sandhi.py | GPT_SoVITS/text/tone_sandhi.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/cleaner.py | GPT_SoVITS/text/cleaner.py | from text import cleaned_text_to_sequence
import os
# if os.environ.get("version","v1")=="v1":
# from text import chinese
# from text.symbols import symbols
# else:
# from text import chinese2 as chinese
# from text.symbols2 import symbols
from text import symbols as symbols_v1
from text import symbols... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/__init__.py | GPT_SoVITS/text/__init__.py | import os
# if os.environ.get("version","v1")=="v1":
# from text.symbols import symbols
# else:
# from text.symbols2 import symbols
from text import symbols as symbols_v1
from text import symbols2 as symbols_v2
_symbol_to_id_v1 = {s: i for i, s in enumerate(symbols_v1.symbols)}
_symbol_to_id_v2 = {s: i for i, s i... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/japanese.py | GPT_SoVITS/text/japanese.py | # modified from https://github.com/CjangCjengh/vits/blob/main/text/japanese.py
import re
import os
import hashlib
try:
import pyopenjtalk
current_file_path = os.path.dirname(__file__)
# 防止win下无法读取模型
if os.name == "nt":
python_dir = os.getcwd()
OPEN_JTALK_DICT_DIR = pyopenjtalk.OPEN_JT... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/char_convert.py | GPT_SoVITS/text/zh_normalization/char_convert.py | # coding=utf-8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | true |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/constants.py | GPT_SoVITS/text/zh_normalization/constants.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/text_normlization.py | GPT_SoVITS/text/zh_normalization/text_normlization.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/phonecode.py | GPT_SoVITS/text/zh_normalization/phonecode.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/num.py | GPT_SoVITS/text/zh_normalization/num.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/chronology.py | GPT_SoVITS/text/zh_normalization/chronology.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/__init__.py | GPT_SoVITS/text/zh_normalization/__init__.py | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/zh_normalization/quantifier.py | GPT_SoVITS/text/zh_normalization/quantifier.py | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/en_normalization/expend.py | GPT_SoVITS/text/en_normalization/expend.py | # by https://github.com/Cosmo-klara
from __future__ import print_function
import re
import inflect
import unicodedata
# 后缀计量单位替换表
measurement_map = {
"m": ["meter", "meters"],
"km": ["kilometer", "kilometers"],
"km/h": ["kilometer per hour", "kilometers per hour"],
"ft": ["feet", "feet"],
"L": ["... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/g2pw/onnx_api.py | GPT_SoVITS/text/g2pw/onnx_api.py | # This code is modified from https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/paddlespeech/t2s/frontend/g2pw
# This code is modified from https://github.com/GitYCC/g2pW
import json
import os
import warnings
import zipfile
from typing import Any, Dict, List, Tuple
import numpy as np
import onnxruntime
import ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/g2pw/g2pw.py | GPT_SoVITS/text/g2pw/g2pw.py | # This code is modified from https://github.com/mozillazg/pypinyin-g2pW
import pickle
import os
from pypinyin.constants import RE_HANS
from pypinyin.core import Pinyin, Style
from pypinyin.seg.simpleseg import simple_seg
from pypinyin.converter import UltimateConverter
from pypinyin.contrib.tone_convert import to_ton... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/g2pw/dataset.py | GPT_SoVITS/text/g2pw/dataset.py | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/g2pw/utils.py | GPT_SoVITS/text/g2pw/utils.py | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/g2pw/__init__.py | GPT_SoVITS/text/g2pw/__init__.py | from text.g2pw.g2pw import *
| python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/LangSegmenter/langsegmenter.py | GPT_SoVITS/text/LangSegmenter/langsegmenter.py | import logging
import re
# jieba静音
import jieba
jieba.setLogLevel(logging.CRITICAL)
# 更改fast_langdetect大模型位置
from pathlib import Path
import fast_langdetect
fast_langdetect.infer._default_detector = fast_langdetect.infer.LangDetector(fast_langdetect.infer.LangDetectConfig(cache_dir=Path(__file__).parent.parent.parent... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/text/LangSegmenter/__init__.py | GPT_SoVITS/text/LangSegmenter/__init__.py | from .langsegmenter import LangSegmenter
| python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/eres2net/fusion.py | GPT_SoVITS/eres2net/fusion.py | # Copyright 3D-Speaker (https://github.com/alibaba-damo-academy/3D-Speaker). All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import torch
import torch.nn as nn
class AFF(nn.Module):
def __init__(self, channels=64, r=4):
super(AFF, self)._... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/eres2net/ERes2Net_huge.py | GPT_SoVITS/eres2net/ERes2Net_huge.py | # Copyright 3D-Speaker (https://github.com/alibaba-damo-academy/3D-Speaker). All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Res2Net implementation is adapted from https://github.com/wenet-e2e/wespeaker.
ERes2Net incorporates both local and global f... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/eres2net/ERes2NetV2.py | GPT_SoVITS/eres2net/ERes2NetV2.py | # Copyright 3D-Speaker (https://github.com/alibaba-damo-academy/3D-Speaker). All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
To further improve the short-duration feature extraction capability of ERes2Net, we expand the channel dimension
within eac... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/eres2net/ERes2Net.py | GPT_SoVITS/eres2net/ERes2Net.py | # Copyright 3D-Speaker (https://github.com/alibaba-damo-academy/3D-Speaker). All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
Res2Net implementation is adapted from https://github.com/wenet-e2e/wespeaker.
ERes2Net incorporates both local and global ... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/eres2net/pooling_layers.py | GPT_SoVITS/eres2net/pooling_layers.py | # Copyright 3D-Speaker (https://github.com/alibaba-damo-academy/3D-Speaker). All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""This implementation is adapted from https://github.com/wenet-e2e/wespeaker."""
import torch
import torch.nn as nn
class T... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | false |
RVC-Boss/GPT-SoVITS | https://github.com/RVC-Boss/GPT-SoVITS/blob/c767f0b83b998e996a4d230d86da575a03f54a3f/GPT_SoVITS/eres2net/kaldi.py | GPT_SoVITS/eres2net/kaldi.py | import math
from typing import Tuple
import torch
import torchaudio
from torch import Tensor
__all__ = [
"get_mel_banks",
"inverse_mel_scale",
"inverse_mel_scale_scalar",
"mel_scale",
"mel_scale_scalar",
"spectrogram",
"fbank",
"mfcc",
"vtln_warp_freq",
"vtln_warp_mel_freq",
]
... | python | MIT | c767f0b83b998e996a4d230d86da575a03f54a3f | 2026-01-04T14:39:21.477961Z | true |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/train.py | train.py | """
This training script can be run both on a single gpu in debug mode,
and also in a larger training run with distributed data parallel (ddp).
To run on a single GPU, example:
$ python train.py --batch_size=32 --compile=False
To run with DDP on 4 gpus on 1 node, example:
$ torchrun --standalone --nproc_per_node=4 tr... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/configurator.py | configurator.py | """
Poor Man's Configurator. Probably a terrible idea. Example usage:
$ python train.py config/override_file.py --batch_size=32
this will first run config/override_file.py, then override batch_size to 32
The code in this file will be run as follows from e.g. train.py:
>>> exec(open('configurator.py').read())
So it's ... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/model.py | model.py | """
Full definition of a GPT Language Model, all of it in this single file.
References:
1) the official GPT-2 TensorFlow implementation released by OpenAI:
https://github.com/openai/gpt-2/blob/master/src/model.py
2) huggingface/transformers PyTorch implementation:
https://github.com/huggingface/transformers/blob/main/s... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/bench.py | bench.py | """
A much shorter version of train.py for benchmarking
"""
import os
from contextlib import nullcontext
import numpy as np
import time
import torch
from model import GPTConfig, GPT
# -----------------------------------------------------------------------------
batch_size = 12
block_size = 1024
bias = False
real_data ... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/sample.py | sample.py | """
Sample from a trained model
"""
import os
import pickle
from contextlib import nullcontext
import torch
import tiktoken
from model import GPTConfig, GPT
# -----------------------------------------------------------------------------
init_from = 'resume' # either 'resume' (from an out_dir) or a gpt2 variant (e.g. '... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/train_gpt2.py | config/train_gpt2.py | # config for training GPT-2 (124M) down to very nice loss of ~2.85 on 1 node of 8X A100 40GB
# launch as the following (e.g. in a screen session) and wait ~5 days:
# $ torchrun --standalone --nproc_per_node=8 train.py config/train_gpt2.py
wandb_log = True
wandb_project = 'owt'
wandb_run_name='gpt2-124M'
# these make ... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/eval_gpt2_medium.py | config/eval_gpt2_medium.py | # evaluate the base gpt2
# n_layer=24, n_head=16, n_embd=1024
# 350M parameters
batch_size = 8
eval_iters = 500 # use more iterations to get good estimate
eval_only = True
wandb_log = False
init_from = 'gpt2-medium'
| python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/eval_gpt2.py | config/eval_gpt2.py | # evaluate the base gpt2
# n_layer=12, n_head=12, n_embd=768
# 124M parameters
batch_size = 8
eval_iters = 500 # use more iterations to get good estimate
eval_only = True
wandb_log = False
init_from = 'gpt2'
| python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/finetune_shakespeare.py | config/finetune_shakespeare.py | import time
out_dir = 'out-shakespeare'
eval_interval = 5
eval_iters = 40
wandb_log = False # feel free to turn on
wandb_project = 'shakespeare'
wandb_run_name = 'ft-' + str(time.time())
dataset = 'shakespeare'
init_from = 'gpt2-xl' # this is the largest GPT-2 model
# only save checkpoints if the validation loss imp... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/train_shakespeare_char.py | config/train_shakespeare_char.py | # train a miniature character-level shakespeare model
# good for debugging and playing on macbooks and such
out_dir = 'out-shakespeare-char'
eval_interval = 250 # keep frequent because we'll overfit
eval_iters = 200
log_interval = 10 # don't print too too often
# we expect to overfit on this small dataset, so only sa... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/eval_gpt2_xl.py | config/eval_gpt2_xl.py | # evaluate the base gpt2
# n_layer=48, n_head=25, n_embd=1600
# 1558M parameters
batch_size = 8
eval_iters = 500 # use more iterations to get good estimate
eval_only = True
wandb_log = False
init_from = 'gpt2-xl'
| python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/config/eval_gpt2_large.py | config/eval_gpt2_large.py | # evaluate the base gpt2
# n_layer=36, n_head=20, n_embd=1280
# 774M parameters
batch_size = 8
eval_iters = 500 # use more iterations to get good estimate
eval_only = True
wandb_log = False
init_from = 'gpt2-large'
| python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/data/shakespeare_char/prepare.py | data/shakespeare_char/prepare.py | """
Prepare the Shakespeare dataset for character-level language modeling.
So instead of encoding with GPT-2 BPE tokens, we just map characters to ints.
Will save train.bin, val.bin containing the ids, and meta.pkl containing the
encoder and decoder and some other related info.
"""
import os
import pickle
import reques... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/data/shakespeare/prepare.py | data/shakespeare/prepare.py | import os
import requests
import tiktoken
import numpy as np
# download the tiny shakespeare dataset
input_file_path = os.path.join(os.path.dirname(__file__), 'input.txt')
if not os.path.exists(input_file_path):
data_url = 'https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt'
... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
karpathy/nanoGPT | https://github.com/karpathy/nanoGPT/blob/3adf61e154c3fe3fca428ad6bc3818b27a3b8291/data/openwebtext/prepare.py | data/openwebtext/prepare.py | # saves the openwebtext dataset to a binary file for training. following was helpful:
# https://github.com/HazyResearch/flash-attention/blob/main/training/src/datamodules/language_modeling_hf.py
import os
from tqdm import tqdm
import numpy as np
import tiktoken
from datasets import load_dataset # huggingface datasets
... | python | MIT | 3adf61e154c3fe3fca428ad6bc3818b27a3b8291 | 2026-01-04T14:39:28.383466Z | false |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/setup.py | setup.py | #!/usr/bin/env python
import os
import sys
from codecs import open
from setuptools import setup
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 9)
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.stderr.write(
"""
==========================
Unsupported Python version
==========================
This v... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | false |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/api.py | src/requests/api.py | """
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:param method: method for the ... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | false |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/cookies.py | src/requests/cookies.py | """
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `http.cookiejar.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import calendar
import copy
import time
from ._internal_utils import to_native_string
from .compat import Morsel, MutableMapping, coo... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | false |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/compat.py | src/requests/compat.py | """
requests.compat
~~~~~~~~~~~~~~~
This module previously handled import compatibility issues
between Python 2 and Python 3. It remains for backwards
compatibility until the next major version.
"""
import importlib
import sys
# -------
# urllib3
# -------
from urllib3 import __version__ as urllib3_version
# Detect... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | false |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/models.py | src/requests/models.py | """
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import datetime
# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP,
# such as in Embedded Python. See https://github.com/p... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | true |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/exceptions.py | src/requests/exceptions.py | """
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from urllib3.exceptions import HTTPError as BaseHTTPError
from .compat import JSONDecodeError as CompatJSONDecodeError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while ha... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | false |
psf/requests | https://github.com/psf/requests/blob/70298332899f25826e35e42f8d83425124f755a5/src/requests/utils.py | src/requests/utils.py | """
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import codecs
import contextlib
import io
import os
import re
import socket
import struct
import sys
import tempfile
import warnings
import zipfile
from collections... | python | Apache-2.0 | 70298332899f25826e35e42f8d83425124f755a5 | 2026-01-04T14:39:22.525405Z | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.