|
4 | 4 | "metadata": { |
5 | 5 | "colab": { |
6 | 6 | "provenance": [], |
| 7 | + "gpuType": "T4", |
7 | 8 | "collapsed_sections": [ |
8 | 9 | "MP5rRkbTpnG8", |
9 | 10 | "Wv0gfI5feBSc", |
|
20 | 21 | }, |
21 | 22 | "language_info": { |
22 | 23 | "name": "python" |
23 | | - } |
| 24 | + }, |
| 25 | + "accelerator": "GPU" |
24 | 26 | }, |
25 | 27 | "cells": [ |
26 | 28 | { |
|
687 | 689 | "from IPython.display import clear_output\n", |
688 | 690 | "clear_output()\n", |
689 | 691 | "import os\n", |
| 692 | + "import zipfile\n", |
690 | 693 | "#@markdown <font size=\"-1.5\"> select this if you don't want to see the onnx converter's output\n", |
691 | 694 | "no_output = True # @param {type:\"boolean\"}\n", |
692 | 695 | "\n", |
|
880 | 883 | " !cp {exp_folder}/onnx/acoustic/phonemes.txt /content/OU_compatible_files/enunux_base >/dev/null 2>&1\n", |
881 | 884 | " !cp {dsdict_path} /content/OU_compatible_files/enunux_base >/dev/null 2>&1 #enunux doesnt need this but it doesnt hurt to include this file with it\n", |
882 | 885 | " !mv /content/OU_compatible_files/enunux_base /content/OU_compatible_files/OU_voicebank\n", |
883 | | - " !zip {exp_folder}/OU_compatible_vb.zip /content/OU_compatible_files/OU_voicebank/* >/dev/null 2>&1\n", |
884 | | - "\n", |
| 886 | + " folder_to_zip = \"/content/OU_compatible_files/OU_voicebank\"\n", |
| 887 | + " output_zip_filename = exp_folder + \"/OU_voicebank.zip\"\n", |
| 888 | + " with zipfile.ZipFile(output_zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:\n", |
| 889 | + " for root, dirs, files in os.walk(folder_to_zip):\n", |
| 890 | + " for file in files:\n", |
| 891 | + " file_path = os.path.join(root, file)\n", |
| 892 | + " relative_path = os.path.relpath(file_path, folder_to_zip)\n", |
| 893 | + " zipf.write(file_path, relative_path)\n", |
885 | 894 | "else:\n", |
886 | 895 | " acoustic_1 = f\"{acoustic_onnx_exp}\" + \"/acoustic.onnx\"\n", |
887 | 896 | " variance_1 = f\"{variance_onnx_exp}\" + \"/variance.onnx\"\n", |
|
903 | 912 | " !rm /content/OU_compatible_files/variance_base/dsdict.yaml\n", |
904 | 913 | " !cp {dsdict_path} /content/OU_compatible_files/variance_base\n", |
905 | 914 | " !mv /content/OU_compatible_files/variance_base /content/OU_compatible_files/OU_voicebank\n", |
906 | | - " !zip {exp_folder}/OU_compatible_vb.zip /content/OU_compatible_files/OU_voicebank/* >/dev/null 2>&1\n", |
| 915 | + " folder_to_zip = \"/content/OU_compatible_files/OU_voicebank\"\n", |
| 916 | + " output_zip_filename = exp_folder + \"/OU_voicebank.zip\"\n", |
| 917 | + " with zipfile.ZipFile(output_zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:\n", |
| 918 | + " for root, dirs, files in os.walk(folder_to_zip):\n", |
| 919 | + " for file in files:\n", |
| 920 | + " file_path = os.path.join(root, file)\n", |
| 921 | + " relative_path = os.path.relpath(file_path, folder_to_zip)\n", |
| 922 | + " zipf.write(file_path, relative_path)\n", |
907 | 923 | "\n", |
908 | 924 | "print(\"\\n\")\n", |
909 | 925 | "print(\"Go extract and edit character.txt and character.yaml to your liking for OpenUtau <3\")\n" |
|
0 commit comments