Spaces:
Runtime error
Runtime error
xJuuzouYTx commited on
Commit ·
42cf67e
1
Parent(s): 66d588d
[ADD] error messages
Browse filesFiles changed (4)
- RVC_BOOK.ipynbAdded+36
- app.py+7
- inference.py+6
- utils/model.py+2-17
123456789101112131415161718192021222324252627282930313233343536{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# <font color='#018ada'>ULTIVC Juuxn Version</font>\n", "---\n", " **[YouTube](https://www.youtube.com/@Juuxn)**\n", "\n", "**Enlaces que podrían interesarte:**\n", "\n", "- [Tutorial para este cuaderno](https://www.youtube.com/watch?v=gTWA2qyzX7k) - [Tutorial para cuaderno tradicional](https://www.youtube.com/embed/R8-PivPpv8o) - [Transferir archivo de mega a Drive](https://colab.research.google.com/drive/1utTesfmBv-uQ8Upa7TEVpM57kmcq9YN6?usp=sharing)\n", "---" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "vscode": { "languageId": "plaintext" } }, "outputs": [], "source": [] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 2}69 unmodified lines70717273747569 unmodified linesdef post_model(name, model_url, version, creator):modelname = model_downloader(model_url, zips_folder, unzips_folder)model_files = get_model(unzips_folder, modelname)md5_hash = calculate_md5(os.path.join(unzips_folder,model_files['pth']))zipfile = compress(modelname, list(model_files.values()))file_to_upload = open(zipfile, "rb")69 unmodified lines7071727374757677787980818269 unmodified linesdef post_model(name, model_url, version, creator):modelname = model_downloader(model_url, zips_folder, unzips_folder)model_files = get_model(unzips_folder, modelname)if not model_files:return "No se encontrado un modelo valido, verifica el contenido del enlace e intentalo más tarde."if not model_files.get('pth'):return "No se encontrado un modelo valido, verifica el contenido del enlace e intentalo más tarde."md5_hash = calculate_md5(os.path.join(unzips_folder,model_files['pth']))zipfile = compress(modelname, list(model_files.values()))file_to_upload = open(zipfile, "rb")
197 unmodified lines198199200201202203197 unmodified linesmodelname = model.model_downloader(self._model_name, "./zips/", "./weights/")model_info = model.get_model(os.path.join(current_dir, 'weights') , modelname)index = model_info.get('index', '')pth = model_info.get('pth', None)197 unmodified lines198199200201202203204205206207208209197 unmodified linesmodelname = model.model_downloader(self._model_name, "./zips/", "./weights/")model_info = model.get_model(os.path.join(current_dir, 'weights') , modelname)if not model_info:return "No se encontrado un modelo valido, verifica el contenido del enlace e intentalo más tarde."if not model_info.get('pth'):return "No se encontrado un modelo valido, verifica el contenido del enlace e intentalo más tarde."index = model_info.get('index', '')pth = model_info.get('pth', None)
99 unmodified lines10010110210310410510610710810911011111211311411511611711811912012112212312412512699 unmodified lineselse:return Nonedef get_models(weight_path):# Obtener todos los elementos en la rutafiles = os.listdir(weight_path)# Filtrar solo los directoriosreturn [file for file in files if os.path.isdir(os.path.join(weight_path, file))]def get_model(weight_path, modelname):resources = {}for root, dirs, files in os.walk(os.path.join(weight_path, modelname)):for file in files:if file.endswith('.index'):resources['index'] = os.path.relpath(os.path.join(root, file))if file.endswith('.pth'):resources['pth'] = os.path.relpath(os.path.join(root, file), start=weight_path)return resourcesdef get_audios(audios_path):# Obtener todos los elementos en la rutafiles = os.listdir(audios_path)# Filtrar solo los directoriosreturn [file for file in files if not os.path.isdir(os.path.join(audios_path, file)) and os.path.join(audios_path, file).endswith(('.mp3', '.wav'))]99 unmodified lines10010110210310410510610710810911011199 unmodified lineselse:return Nonedef get_model(weight_path, modelname):resources = {}for root, dirs, files in os.walk(os.path.join(weight_path, modelname)):for file in files:if file.endswith('.index'):resources['index'] = os.path.relpath(os.path.join(root, file))if file.endswith('.pth') and not 'G_' in file and not 'D_' in file:resources['pth'] = os.path.relpath(os.path.join(root, file), start=weight_path)return resources
RVC_BOOK.ipynbAdded+36
app.py+7
inference.py+6
utils/model.py+2-17