Skip to content

Commit

Permalink
fix: minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkanDash committed Aug 18, 2023
1 parent d2060c9 commit 6157293
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 35 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,3 @@ jobs:
sudo apt-get install -qq -y aria2
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d /home/runner/work/Advanced-RVC-Inference/Advanced-RVC-Inference -o hubert_base.pt
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/rmvpe.pt -d /home/runner/work/Advanced-RVC-Inference/Advanced-RVC-Inference -o rmvpe.pt
- name: Test application
run: |
python infer.py
14 changes: 12 additions & 2 deletions Advanced-RVC.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#@title Check GPU\n",
"!nvidia-smi"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -10,7 +20,7 @@
"!apt-get update\n",
"!apt-get install -qq -y aria2\n",
"!git clone -b master https://github.com/ArkanDash/Advanced-RVC-Inference\n",
"!pip install -r /content/Multi-Model-RVC-Inference/requirements.txt"
"!pip install -r /content/Advanced-RVC-Inference/requirements.txt"
]
},
{
Expand All @@ -32,7 +42,7 @@
"source": [
"#@title Run\n",
"%cd /content/Advanced-RVC-Inference\n",
"!python infer.py"
"!python infer.py --colab"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Advanced RVC Inference

[![Colab](https://img.shields.io/badge/Colab-Advanced%20RVC%20Inference-blue?style=for-the-badge&logo=googlecolab)](https://colab.research.google.com/github/ArkanDash/Advanced-RVC-Inference/blob/main/Advanced-RVC.ipynb)
[![Colab](https://img.shields.io/badge/Colab-Advanced%20RVC%20Inference-blue?style=for-the-badge&logo=googlecolab)](https://colab.research.google.com/github/ArkanDash/Advanced-RVC-Inference/blob/master/Advanced-RVC.ipynb)
</div>

### Information
Expand Down
56 changes: 28 additions & 28 deletions infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def get_vc(sid, to_return_protect0):

def download_audio(url, audio_provider):
logs = []
os.mkdir("dl_audio", exist_ok=True)
os.makedirs("dl_audio", exist_ok=True)
if url == "":
logs.append("URL required!")
yield None, "\n".join(logs)
Expand All @@ -310,34 +310,34 @@ def download_audio(url, audio_provider):
logs.append("Download Complete.")
yield audio_path, "\n".join(logs)

def cut_vocal_and_inst(split_model, audio_mode):
def cut_vocal_and_inst_yt(split_model):
logs = []
logs.append("Starting the audio splitting process...")
if audio_mode == "Upload audio":
yield "\n".join(logs), None, None, None
command = f"demucs --two-stems=vocals -n {split_model} dl_audio/audio.wav -o output"
result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
for line in result.stdout:
logs.append(line)
yield "\n".join(logs), None, None, None
command = f"demucs --two-stems=vocals -n {split_model} dl_audio/audio.wav -o output"
result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
for line in result.stdout:
logs.append(line)
yield "\n".join(logs), None, None, None
print(result.stdout)
vocal = f"output/{split_model}/audio/vocals.wav"
inst = f"output/{split_model}/audio/no_vocals.wav"
logs.append("Audio splitting complete.")
yield "\n".join(logs), vocal, inst, vocal
else:
yield "\n".join(logs), None, None
command = f"demucs --two-stems=vocals -n {split_model} dl_audio/audio.wav -o output"
result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
for line in result.stdout:
logs.append(line)
yield "\n".join(logs), None, None
print(result.stdout)
vocal = f"output/{split_model}/audio/vocals.wav"
inst = f"output/{split_model}/audio/no_vocals.wav"
logs.append("Audio splitting complete.")
yield "\n".join(logs), vocal, inst
print(result.stdout)
vocal = f"output/{split_model}/audio/vocals.wav"
inst = f"output/{split_model}/audio/no_vocals.wav"
logs.append("Audio splitting complete.")
yield "\n".join(logs), vocal, inst, vocal

def cut_vocal_and_inst(split_model):
yield "\n".join(logs), None, None
command = f"demucs --two-stems=vocals -n {split_model} dl_audio/audio.wav -o output"
result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
for line in result.stdout:
logs.append(line)
yield "\n".join(logs), None, None
print(result.stdout)
vocal = f"output/{split_model}/audio/vocals.wav"
inst = f"output/{split_model}/audio/no_vocals.wav"
logs.append("Audio splitting complete.")
yield "\n".join(logs), vocal, inst

def combine_vocal_and_inst(audio_data, vocal_volume, inst_volume, split_model):
if not os.path.exists("output/result"):
os.mkdir("output/result")
Expand Down Expand Up @@ -702,13 +702,13 @@ def change_audio_mode(vc_audio_mode):
outputs=[vc_audio_preview, vc_log_yt]
)
vc_split_yt.click(
fn=cut_vocal_and_inst,
inputs=[vc_split_model, vc_audio_mode],
fn=cut_vocal_and_inst_yt,
inputs=[vc_split_model],
outputs=[vc_split_log, vc_vocal_preview, vc_inst_preview, vc_input]
)
vc_split.click(
fn=cut_vocal_and_inst,
inputs=[vc_split_model, vc_audio_mode],
inputs=[vc_split_model],
outputs=[vc_split_log, vc_vocal_preview, vc_inst_preview]
)
vc_combine.click(
Expand Down

0 comments on commit 6157293

Please sign in to comment.