Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: cosyvoice support pt file #2431

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Minamiyama
Copy link
Contributor

@Minamiyama Minamiyama commented Oct 12, 2024

If you need to use a custom .pt file, please set the folder path of the .pt file in the environment variable COSYVOICE_PT_PATH beforehand.

如果需要使用自定义pt文件,请先在环境变量COSYVOICE_PT_PATH中设置pt文件所在的文件夹路径

@XprobeBot XprobeBot added the enhancement New feature or request label Oct 12, 2024
@XprobeBot XprobeBot added this to the v0.15 milestone Oct 12, 2024
@Minamiyama
Copy link
Contributor Author

docker设置参考:
image

@qinxuye
Copy link
Contributor

qinxuye commented Oct 14, 2024

Is this PR ready for review?

@Minamiyama
Copy link
Contributor Author

Is this PR ready for review?

yes 😄

@qinxuye
Copy link
Contributor

qinxuye commented Oct 14, 2024

Can you add some doc to

to tell users how to leverage this feature?

@Minamiyama
Copy link
Contributor Author

Can you add some doc to

to tell users how to leverage this feature?

committed

@codingl2k1
Copy link
Contributor

Please fix the GPU CI: https://github.com/xorbitsai/inference/actions/runs/11323214004/job/31485465795?pr=2431. It would be good to add a CI case for the .pt file as well.

for i in self.frontend.text_normalize(tts_text, split=True):
model_input = self.frontend.frontend_sft(i, spk_id)
if newspk is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that the newspk is not defined? e.g. the if condition above is not true.

@@ -49,8 +53,29 @@ def list_avaliable_spks(self):
return spks

def inference_sft(self, tts_text, spk_id, stream=False):
if spk_id not in self.default_voices and os.environ["COSYVOICE_PT_PATH"] is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The os.environ["COSYVOICE_PT_PATH"] may raise a KeyError when spk_id not in self.default_voices. Is this expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants