add top_p and repetition_penalty to playht3.0

This commit is contained in:
Quan HL
2024-10-03 19:24:23 +07:00
parent 05fc96edc0
commit f6cead6e92

View File

@@ -764,8 +764,7 @@ const synthPlayHT = async(client, logger, {
let synthesizeUrl = 'https://api.play.ht/api/v2/tts/stream';
// If model is play3.0, the stream url is provided by v3 auth endpoint which is
// including jwt token as request params.
// If model is play3.0, the synthesizeUrl is got from authentication endpoint
if (voice_engine === 'Play3.0') {
try {
const post = bent('https://api.play.ht', 'POST', 'json', 201, {
@@ -806,6 +805,8 @@ const synthPlayHT = async(client, logger, {
if (opts.voice_guidance) params += `,voice_guidance=${opts.voice_guidance}`;
if (opts.style_guidance) params += `,style_guidance=${opts.style_guidance}`;
if (opts.text_guidance) params += `,text_guidance=${opts.text_guidance}`;
if (opts.top_p) params += `,top_p=${opts.top_p}`;
if (opts.repetition_penalty) params += `,repetition_penalty=${opts.repetition_penalty}`;
params += '}';
return {