mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 16:53:55 +03:00
14 lines
358 B
Python
14 lines
358 B
Python
|
import torch
|
||
|
from transformers import HubertModel
|
||
|
from voice_changer.utils.VoiceChangerModel import AudioInOut
|
||
|
|
||
|
|
||
|
class RinnaHubertBase:
|
||
|
def __init__(self):
|
||
|
model = HubertModel.from_pretrained("rinna/japanese-hubert-base")
|
||
|
model.eval()
|
||
|
self.model = model
|
||
|
|
||
|
def extract(self, audio: AudioInOut):
|
||
|
return self.model(audio)
|