From 17db19d2ebcdfa5a726b28640f92c37b09350027 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 20 Jan 2024 00:33:13 +0000 Subject: [PATCH] chore(format): run black on main --- assets/Applio.ipynb | 163 +++++++++++++++++++------------------ assets/discord_presence.py | 2 + rvc/infer/infer.py | 18 ++-- rvc/train/train.py | 4 +- 4 files changed, 98 insertions(+), 89 deletions(-) diff --git a/assets/Applio.ipynb b/assets/Applio.ipynb index 762e51f82..1f4cad9c6 100644 --- a/assets/Applio.ipynb +++ b/assets/Applio.ipynb @@ -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 } \ No newline at end of file diff --git a/assets/discord_presence.py b/assets/discord_presence.py index b1eff732f..a89e42d21 100644 --- a/assets/discord_presence.py +++ b/assets/discord_presence.py @@ -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() diff --git a/rvc/infer/infer.py b/rvc/infer/infer.py index 69c645bc5..d9188202e 100644 --- a/rvc/infer/infer.py +++ b/rvc/infer/infer.py @@ -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: diff --git a/rvc/train/train.py b/rvc/train/train.py index 961db6480..8fb4a14e4 100644 --- a/rvc/train/train.py +++ b/rvc/train/train.py @@ -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."