Skip to content

Commit

Permalink
add top_p and repetition_penalty to playht3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Oct 3, 2024
1 parent 05fc96e commit f6cead6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/synth-audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f6cead6

Please sign in to comment.