feat: set custom cache directory (#227)
This commit is contained in:
@@ -126,9 +126,9 @@ export class KokoroTTS {
|
|||||||
splitter = new TextSplitterStream();
|
splitter = new TextSplitterStream();
|
||||||
const chunks = split_pattern
|
const chunks = split_pattern
|
||||||
? text
|
? text
|
||||||
.split(split_pattern)
|
.split(split_pattern)
|
||||||
.map((chunk) => chunk.trim())
|
.map((chunk) => chunk.trim())
|
||||||
.filter((chunk) => chunk.length > 0)
|
.filter((chunk) => chunk.length > 0)
|
||||||
: [text];
|
: [text];
|
||||||
splitter.push(...chunks);
|
splitter.push(...chunks);
|
||||||
} else {
|
} else {
|
||||||
@@ -150,6 +150,12 @@ export class KokoroTTS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const env = {
|
export const env = {
|
||||||
|
set cacheDir(value) {
|
||||||
|
hf.cacheDir = value
|
||||||
|
},
|
||||||
|
get cacheDir() {
|
||||||
|
return hf.cacheDir
|
||||||
|
},
|
||||||
set wasmPaths(value) {
|
set wasmPaths(value) {
|
||||||
hf.backends.onnx.wasm.wasmPaths = value;
|
hf.backends.onnx.wasm.wasmPaths = value;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user