PlayVoice / whisper-vits-svc

Core Engine of Singing Voice Conversion & Singing Voice Clone
https://huggingface.co/spaces/maxmax20160403/sovits5.0
MIT License
2.55k stars 914 forks source link

There's a bug here, and I tried to fix it. "/root/VITS/so-vits-svc-5.0-bigvgan-mix-v2/feature_retrieval/index.py" #160

Closed Siegelth closed 6 months ago

Siegelth commented 6 months ago

Traceback (most recent call last): File "svc_inference.py", line 14, in from feature_retrieval import IRetrieval, DummyRetrieval, FaissIndexRetrieval, load_retrieve_index File "/root/VITS/so-vits-svc-5.0-bigvgan-mix-v2/feature_retrieval/init.py", line 1, in from .index import * File "/root/VITS/so-vits-svc-5.0-bigvgan-mix-v2/feature_retrieval/index.py", line 97, in class FaissIVFTrainableFeatureIndex(FaissFeatureIndex[IndexIVF]): File "/root/VITS/so-vits-svc-5.0-bigvgan-mix-v2/feature_retrieval/index.py", line 119, in FaissIVFTrainableFeatureIndex def _split_matrix_by_batch(self, feature_matrix: NumpyArray) -> list[NumpyArray]: TypeError: 'type' object is not subscriptable

This error is due to a problem with type hints such as list[NumpyArray] in the code. I think this syntax was not supported in earlier versions of Python.

My python version is 3.8.10, and I change:

def _split_matrix_by_batch(self, feature_matrix: NumpyArray) -> list[NumpyArray]:

to

from typing import List def _split_matrix_by_batch(self, feature_matrix: NumpyArray) -> List[NumpyArray]:

and it works.

futorio commented 6 months ago

Hi. In conda environment interpreter's version set as python=3.11.5 I think you should run code with this python version

Siegelth commented 6 months ago

Hi. In conda environment interpreter's version set as python=3.11.5 I think you should run code with this python version

Hi there, thank you for your reply. I can run index.py successfully in the version of 3.8.10 by changing split matrix by batch. Confusingly, I don't see a guide on the Python version for this project. So I concur that it's necessary for the code to be compatible with all Python versions.