From c7779116c51b5f21cc5221518c36b4ca6e39b54e Mon Sep 17 00:00:00 2001 From: Alex Murkoff <413x1nkp@gmail.com> Date: Fri, 14 Jun 2024 20:45:45 +0700 Subject: [PATCH] chore: remove type subscription for np.ndarray specification (#56) * chore: remove type subscription for np.ndarray specification this is done to avoid errors on python<3.9 * chore: remove import of `Any` from typing since it's unused --- rvc/f0/f0.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rvc/f0/f0.py b/rvc/f0/f0.py index 607c268..0f615e6 100644 --- a/rvc/f0/f0.py +++ b/rvc/f0/f0.py @@ -1,4 +1,4 @@ -from typing import Any, Optional, Union +from typing import Optional, Union import torch import numpy as np @@ -23,12 +23,12 @@ class F0Predictor(object): def compute_f0( self, - wav: np.ndarray[Any, np.dtype], + wav: np.ndarray, p_len: Optional[int] = None, filter_radius: Optional[Union[int, float]] = None, ): ... - def _interpolate_f0(self, f0: np.ndarray[Any, np.dtype]): + def _interpolate_f0(self, f0: np.ndarray): """ 对F0进行插值处理 """ @@ -66,7 +66,7 @@ class F0Predictor(object): return ip_data[:, 0], vuv_vector[:, 0] - def _resize_f0(self, x: np.ndarray[Any, np.dtype], target_len: int): + def _resize_f0(self, x: np.ndarray, target_len: int): source = np.array(x) source[source < 0.001] = np.nan target = np.interp(