Skip to content

Commit

Permalink
Merge pull request #192 from IAHispano/formatter-main
Browse files Browse the repository at this point in the history
chore(format): run black on main
blaisewf authored Jan 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 5f16923 + 17db19d commit a895385
Showing 4 changed files with 98 additions and 89 deletions.
163 changes: 82 additions & 81 deletions assets/Applio.ipynb
Original file line number Diff line number Diff line change
@@ -1,84 +1,85 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "vtON700qokuQ"
},
"outputs": [],
"source": [
"# @title **Install Applio**\n",
"\n",
"import codecs\n",
"import time\n",
"\n",
"orig_name_of_program = codecs.decode(\"Nccyvb\", \"rot_13\")\n",
"new_name_of_program = codecs.decode(\"cebtenz\", \"rot_13\")\n",
"uioawhd = codecs.decode(\"uggcf://tvguho.pbz/VNUvfcnab/Nccyvb.tvg\", \"rot_13\")\n",
"uyadwa = codecs.decode(\"ncc.cl\", \"rot_13\")\n",
"\n",
"from IPython.display import clear_output, Javascript\n",
"\n",
"!git clone --depth 1 $uioawhd\n",
"!mv $orig_name_of_program $new_name_of_program\n",
"%cd $new_name_of_program/\n",
"\n",
"clear_output()\n",
"file_path = \"requirements.txt\"\n",
"!pip install -r \"requirements.txt\" --quiet\n",
"\n",
"clear_output()\n",
"print(\"Finished installing requirements!\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "-7cQtXouqpQi"
},
"outputs": [],
"source": [
"# @title **Start Applio**\n",
"import codecs\n",
"uyadwa = codecs.decode(\"ncc.cl\", \"rot_13\")\n",
"\n",
"%load_ext tensorboard\n",
"%reload_ext tensorboard\n",
"%tensorboard --logdir logs --bind_all\n",
"\n",
"!python $uyadwa --share"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ymhGfgFSR17k"
},
"source": [
"## **Credits**\n",
"- Special thanks to [Hina](https://github.com/hinabl) 💗\n",
"- [Blaise](https://github.com/blaise-tk) and [Applio Team](https://github.com/IAHispano)"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"gpuType": "T4",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "vtON700qokuQ"
},
"outputs": [],
"source": [
"# @title **Install Applio**\n",
"\n",
"import codecs\n",
"import time\n",
"\n",
"orig_name_of_program = codecs.decode(\"Nccyvb\", \"rot_13\")\n",
"new_name_of_program = codecs.decode(\"cebtenz\", \"rot_13\")\n",
"uioawhd = codecs.decode(\"uggcf://tvguho.pbz/VNUvfcnab/Nccyvb.tvg\", \"rot_13\")\n",
"uyadwa = codecs.decode(\"ncc.cl\", \"rot_13\")\n",
"\n",
"from IPython.display import clear_output, Javascript\n",
"\n",
"!git clone --depth 1 $uioawhd\n",
"!mv $orig_name_of_program $new_name_of_program\n",
"%cd $new_name_of_program/\n",
"\n",
"clear_output()\n",
"file_path = \"requirements.txt\"\n",
"!pip install -r \"requirements.txt\" --quiet\n",
"\n",
"clear_output()\n",
"print(\"Finished installing requirements!\")"
]
},
"nbformat": 4,
"nbformat_minor": 0
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "-7cQtXouqpQi"
},
"outputs": [],
"source": [
"# @title **Start Applio**\n",
"import codecs\n",
"\n",
"uyadwa = codecs.decode(\"ncc.cl\", \"rot_13\")\n",
"\n",
"%load_ext tensorboard\n",
"%reload_ext tensorboard\n",
"%tensorboard --logdir logs --bind_all\n",
"\n",
"!python $uyadwa --share"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ymhGfgFSR17k"
},
"source": [
"## **Credits**\n",
"- Special thanks to [Hina](https://github.com/hinabl) 💗\n",
"- [Blaise](https://github.com/blaise-tk) and [Applio Team](https://github.com/IAHispano)"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"gpuType": "T4",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
2 changes: 2 additions & 0 deletions assets/discord_presence.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
import datetime as dt
import time


def rich_presence():
client_id = "1144714449563955302"
RPC = Presence(client_id)
@@ -23,6 +24,7 @@ def rich_presence():
print(f"An error occurred: {e}")
return None


if __name__ == "__main__":
rpc = rich_presence()

18 changes: 11 additions & 7 deletions rvc/infer/infer.py
Original file line number Diff line number Diff line change
@@ -83,7 +83,9 @@ 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)
@@ -108,14 +110,17 @@ 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,
@@ -137,7 +142,6 @@ 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")
@@ -243,7 +247,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:
4 changes: 3 additions & 1 deletion rvc/train/train.py
Original file line number Diff line number Diff line change
@@ -573,7 +573,9 @@ def train_and_evaluate(rank, epoch, hps, nets, optims, scaler, loaders, writers,
)

if rank == 0:
print(f"{hps.name} | epoch={epoch} | step={global_step} | {epoch_recorder.record()} | loss_disc={loss_disc:.3f} | loss_gen={loss_gen:.3f} | loss_fm={loss_fm:.3f} | loss_mel={loss_mel:.3f} | loss_kl={loss_kl:.3f}")
print(
f"{hps.name} | epoch={epoch} | step={global_step} | {epoch_recorder.record()} | loss_disc={loss_disc:.3f} | loss_gen={loss_gen:.3f} | loss_fm={loss_fm:.3f} | loss_mel={loss_mel:.3f} | loss_kl={loss_kl:.3f}"
)
if epoch >= hps.total_epoch and rank == 0:
print(
f"Training has been successfully completed with {epoch} epoch and {global_step} steps."

0 comments on commit a895385

Please sign in to comment.