Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ async function runChatterboxTTS (payload) {

logger.info(`[Chatterbox] Processing ${texts.length} texts`)

// Resolve paths relative to benchmarks directory if not absolute
let modelDir = config.modelDir || DEFAULT_MODEL_DIR
if (!path.isAbsolute(modelDir)) {
modelDir = path.join(BENCHMARKS_DIR, modelDir)
modelDir = path.isAbsolute(modelDir) ? modelDir : path.join(BENCHMARKS_DIR, modelDir)
modelDir = path.resolve(modelDir)
if (!modelDir.startsWith(BENCHMARKS_DIR) && !modelDir.startsWith(SHARED_DATA_DIR)) {
throw new Error('modelDir must be within the benchmarks or shared-data directory')
}

const tokenizerPath = path.join(modelDir, 'tokenizer.json')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ async function runSupertonicTTS (payload) {
logger.info(`[Supertonic] Processing ${texts.length} texts`)

let modelDir = config.modelDir || DEFAULT_MODEL_DIR
if (!path.isAbsolute(modelDir)) {
modelDir = path.join(BENCHMARKS_DIR, modelDir)
modelDir = path.isAbsolute(modelDir) ? modelDir : path.join(BENCHMARKS_DIR, modelDir)
modelDir = path.resolve(modelDir)
if (!modelDir.startsWith(BENCHMARKS_DIR) && !modelDir.startsWith(SHARED_DATA_DIR)) {
throw new Error('modelDir must be within the benchmarks or shared-data directory')
}

const voiceName = config.voiceName || 'F1'
Expand Down
Loading