mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-06-02 05:50:39 +00:00
fix types
This commit is contained in:
@@ -2,22 +2,18 @@ from sbv2_bindings import TTSModel
|
||||
|
||||
|
||||
def main():
|
||||
with open("../models/debert.onnx", "rb") as f:
|
||||
bert = f.read()
|
||||
with open("../models/tokenizer.json", "rb") as f:
|
||||
tokenizer = f.read()
|
||||
print("Loading models...")
|
||||
|
||||
model = TTSModel(bert, tokenizer)
|
||||
model = TTSModel.from_path("../models/debert.onnx", "../models/tokenizer.json")
|
||||
print("Models loaded!")
|
||||
|
||||
with open("../models/amitaro.sbv2", "rb") as f:
|
||||
model.load_sbv2file(f.read())
|
||||
model.load_sbv2file_from_path("amitaro", "../models/amitaro.sbv2")
|
||||
print("All setup is done!")
|
||||
|
||||
style_vector = model.get_style_vector("amitaro", 0, 1.0)
|
||||
with open("output.wav", "wb") as f:
|
||||
f.write(model.synthesize("こんにちは", "amitaro", style_vector, 0.0, 0.5))
|
||||
data = model.synthesize("こんにちは", "amitaro", style_vector, 0.0, 0.5)
|
||||
print(data)
|
||||
f.write(data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user