Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Jan 19, 2024
1 parent 02bd34a commit b368f78
Show file tree
Hide file tree
Showing 32 changed files with 9,872 additions and 141 deletions.
128 changes: 1 addition & 127 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,127 +1 @@
# Applio
*.exe
*.pt
logs
rvc/pretraineds

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
env
4 changes: 4 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import gradio as gr
import sys
import os

now_dir = os.getcwd()
sys.path.append(now_dir)

from assets.i18n.i18n import I18nAuto

Expand Down
4 changes: 4 additions & 0 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import sys
import argparse
import subprocess

now_dir = os.getcwd()
sys.path.append(now_dir)

from rvc.configs.config import Config
from rvc.lib.tools.validators import (
validate_sampling_rate,
Expand Down
18 changes: 7 additions & 11 deletions rvc/infer/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ def vc_single(
result, new_dir_path = process_audio(input_audio_path)
if result == "Error":
return "Error with Split Audio", None
dir_path = (
new_dir_path.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
)
dir_path = new_dir_path.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
if dir_path != "":
paths = [
os.path.join(root, name)
Expand All @@ -110,17 +108,14 @@ def vc_single(
path,
False,
)
# new_dir_path
#new_dir_path
except Exception as error:
print(error)
return "Error", None
print("Finished processing segmented audio, now merging audio...")
merge_timestamps_file = os.path.join(
os.path.dirname(new_dir_path),
f"{os.path.basename(input_audio_path).split('.')[0]}_timestamps.txt",
)
tgt_sr, audio_opt = merge_audio(merge_timestamps_file)

merge_timestamps_file = os.path.join(os.path.dirname(new_dir_path), f"{os.path.basename(input_audio_path).split('.')[0]}_timestamps.txt")
tgt_sr, audio_opt = merge_audio(merge_timestamps_file)

else:
audio_opt = vc.pipeline(
hubert_model,
Expand All @@ -142,6 +137,7 @@ def vc_single(
hop_length,
f0_file=f0_file,
)


if output_path is not None:
sf.write(output_path, audio_opt, tgt_sr, format="WAV")
Expand Down Expand Up @@ -247,7 +243,7 @@ def get_vc(weight_root, sid):
index_rate=index_rate,
hop_length=hop_length,
output_path=output_file,
split_audio=split_audio,
split_audio=split_audio
)

if os.path.exists(output_file) and os.path.getsize(output_file) > 0:
Expand Down
Empty file added rvc/lib/infer_pack/__init__.py
Empty file.
Loading

0 comments on commit b368f78

Please sign in to comment.