mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-12-16 11:48:08 +01:00
Parameter hot update (#1148)
This commit is contained in:
@@ -68,6 +68,7 @@ class RVC:
|
||||
self.index = faiss.read_index(index_path)
|
||||
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
|
||||
print("index search enabled")
|
||||
self.index_path = index_path
|
||||
self.index_rate = index_rate
|
||||
models, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task(
|
||||
["assets/hubert/hubert_base.pt"],
|
||||
@@ -111,7 +112,17 @@ class RVC:
|
||||
self.is_half = config.is_half
|
||||
except:
|
||||
print(traceback.format_exc())
|
||||
|
||||
|
||||
def change_key(self, new_key):
|
||||
self.f0_up_key = new_key
|
||||
|
||||
def change_index_rate(self, new_index_rate):
|
||||
if new_index_rate != 0 and self.index_rate == 0:
|
||||
self.index = faiss.read_index(self.index_path)
|
||||
self.big_npy = self.index.reconstruct_n(0, self.index.ntotal)
|
||||
print("index search enabled")
|
||||
self.index_rate = new_index_rate
|
||||
|
||||
def get_f0_post(self, f0):
|
||||
f0_min = self.f0_min
|
||||
f0_max = self.f0_max
|
||||
|
||||
Reference in New Issue
Block a user