Advertisement
kopyl

Untitled

Apr 25th, 2023
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. apt update
  2. apt-get -y install build-essential python3-dev ffmpeg
  3. pip3 install --upgrade setuptools wheel
  4. pip3 install --upgrade pip
  5. pip3 install faiss-gpu fairseq gradio ffmpeg ffmpeg-python praat-parselmouth pyworld numpy==1.23.5 numba==0.56.4 librosa==0.9.2
  6. apt -y install -qq aria2
  7. pip install mega.py
  8. pip install gdown
  9. apt install git -y
  10. apt install unzip -y
  11.  
  12. cd /workspace
  13. git clone https://github.com/Estil1/Retrieval-based-Voice-Conversion-WebUI
  14. cd Retrieval-based-Voice-Conversion-WebUI
  15. mkdir -p pretrained uvr5_weights
  16. git pull
  17.  
  18. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D32k.pth -d pretrained -o D32k.pth
  19.  
  20. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D40k.pth -d pretrained -o D40k.pth
  21.  
  22. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/D48k.pth -d pretrained -o D48k.pth
  23.  
  24. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G32k.pth -d pretrained -o G32k.pth
  25.  
  26. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G40k.pth -d pretrained -o G40k.pth
  27.  
  28. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/G48k.pth -d pretrained -o G48k.pth
  29.  
  30. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D32k.pth -d pretrained -o f0D32k.pth
  31.  
  32. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D40k.pth -d pretrained -o f0D40k.pth
  33.  
  34. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0D48k.pth -d pretrained -o f0D48k.pth
  35.  
  36. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G32k.pth -d pretrained -o f0G32k.pth
  37.  
  38. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G40k.pth -d pretrained -o f0G40k.pth
  39.  
  40. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/pretrained/f0G48k.pth -d pretrained -o f0G48k.pth
  41.  
  42.  
  43.  
  44. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP2-人声vocals+非人声instrumentals.pth -d uvr5_weights -o HP2-人声vocals+非人声instrumentals.pth
  45.  
  46. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/uvr5_weights/HP5-主旋律人声vocals+其他instrumentals.pth -d uvr5_weights -o HP5-主旋律人声vocals+其他instrumentals.pth
  47.  
  48. aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d . -o hubert_base.pt
  49.  
  50.  
  51.  
  52. mkdir -p /workspace/RVC
  53. mkdir -p /workspace/dataset
  54. mkdir -p /workspace/EasyDataset
  55.  
  56.  
  57.  
  58. export MODELNAME="kanye"
  59. export MODELEPOCH=2333333
  60.  
  61. mkdir -p logs/${MODELNAME}
  62. mkdir -p /workspace/unzips/${MODELNAME}
  63. unzip -d /workspace/unzips/${MODELNAME} -B /workspace/RVC/${MODELNAME}.zip
  64. mv /workspace/unzips/${MODELNAME}/${MODELNAME}_D_${MODELEPOCH}.pth logs/${MODELNAME}/G_${MODELEPOCH}.pth
  65. mv /workspace/unzips/${MODELNAME}/${MODELNAME}_G_${MODELEPOCH}.pth logs/${MODELNAME}/D_${MODELEPOCH}.pth
  66. mv /workspace/unzips/${MODELNAME}/*.index logs/${MODELNAME}/
  67. mv /workspace/unzips/${MODELNAME}/*.npy logs/${MODELNAME}/
  68. mv /workspace/unzips/${MODELNAME}/${MODELNAME}${MODELEPOCH}.pth weights/${MODELNAME}.pth
  69. rm -r /workspace/unzips/${MODELNAME}/
  70.  
  71. python3 infer-web.py --colab --pycmd python3
  72.  
  73.  
  74.  
  75. gdown 1rYm9GXtgUohZjStdfpLSq65kSZqSmqiz
  76. gdown 1ZopwMm3pUNh5psgw6HEPxQrgRWp_tzFo
  77.  
  78.  
  79.  
  80. gdown 1rRLdG-n-35oOjUK3ZNU80xXABNAiqWJx
  81.  
  82.  
  83.  
  84. ---
  85.  
  86. edit `infer-web.py` file
  87.  
  88. 1:
  89.  
  90. I need to manually add the path here:
  91. cpt = torch.load(person, map_location="cpu")
  92.  
  93. 2: run the following line after the definition of the get_vc function to load a model
  94.  
  95. run get_vc("")
  96.  
  97. ---
  98.  
  99. rename 'infer-web.py' with 'inferrr.py' so i can import things from it
  100.  
  101. ---
  102.  
  103. make an import of vc_single:
  104.  
  105. from inferrr import vc_single
  106.  
  107. ---
  108.  
  109. run inference:
  110.  
  111. vc_single(0, '/workspace/RVC/Vanessa.mp3', 0.0, '', 'pm', 'E:\\codes\\py39\\vits_vc_gpu_train\\logs\\mi-test-1key\\added_IVF677_Flat_nprobe_7.index', 'E:\\codes\\py39\\vits_vc_gpu_train\\logs\\mi-test-1key\\total_fea.npy', 0.6)
  112. song_output = ...^
  113.  
  114. it returns an audio and sampling rate. Save an audio with the right sampling rate like this
  115. ('Success', (40000, array([ -5, -5, -5, ..., 1481, 590, -489], dtype=int16))
  116.  
  117. def get_audio
  118. if song_output and song_output[0] == 'Success':
  119. success =
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement