Skip to content

How do I get embedding and use it in different parts of code? #3812

Answered by Egor-oop
Egor-oop asked this question in General Q&A
Discussion options

You must be logged in to vote

My question got resolved. Here is an example code:

import os
import torch
import torchaudio
from TTS.tts.configs.xtts_config import XttsConfig
from TTS.tts.models.xtts import Xtts

# /Users/egorgulido/Library/"Application Support"/tts/tts_models--multilingual--multi-dataset--xtts_v2

xtts_path = '/Users/egorgulido/Library/Application Support/tts/tts_models--multilingual--multi-dataset--xtts_v2'
print("Loading model...")
config = XttsConfig()
config.load_json(xtts_path + '/config.json')
model = Xtts.init_from_config(config)
model.load_checkpoint(config, checkpoint_dir=xtts_path, use_deepspeed=False)
# model.cuda()

print("Computing speaker latents...")
gpt_cond_latent, speaker_embedding = m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Egor-oop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant