Skip to content

Commit 685129f

Browse files
committed
add missing title, set max tts length to 1024, updated lite (+2 squashed commit)
Squashed commit: [0737a02] add missing title [a42328b] add max tts length 1024
1 parent bcaf379 commit 685129f

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

klite.embd

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6021,8 +6021,8 @@ Current version indicated by LITEVER below.
60216021
};
60226022
const replaceLatex = (input) =>{
60236023
//all latex patterns except inline tex
6024-
input = input.replace(/(^```math\n([\s\S]*?)\n```$|^ {0,6}\\\[\n([\s\S]*?)\n {0,6}\\\]$|^\$\$\n([\s\S]*?)\n\$\$$|\$\$([^\n]+?)\$\$|\\\(([^\n]+?)\\\)|\\\[([^\n]+?)\\\])/gm, (match, p1, p2, p3, p4, p5, p6, p7) => {
6025-
let content = p2 || p3 || p4 || p5 || p6 || p7;
6024+
input = input.replace(/(^```math\n([\s\S]*?)\n```$|^ {0,6}\\\[\n([\s\S]*?)\n {0,6}\\\]$|^\$\$\n([\s\S]*?)\n\$\$$|^ {2}\$\$\n {2}([\s\S]*?)\n {2}\$\$$|\$\$([^\n]+?)\$\$|\\\(([^\n]+?)\\\)|\\\[([^\n]+?)\\\])/gm, (match, p1, p2, p3, p4, p5, p6, p7, p8) => {
6025+
let content = p2 || p3 || p4 || p5 || p6 || p7 || p8;
60266026
const matchedlw = match.match(/^[ \t]*/);
60276027
const leadingWhitespace = matchedlw ? matchedlw[0] : '';
60286028
content = unescape_html(content);
@@ -6032,23 +6032,32 @@ Current version indicated by LITEVER below.
60326032
}
60336033
return leadingWhitespace + temml.renderToString(content); // render LaTeX content
60346034
});
6035-
input = input.replace(/(?:^|[^\\])\$(\S[^$\n]*?\S)\$(?!\d)/g, (match, p1) => {
6035+
input = input.replace(/(^|[^\\])\$(\S[^$\n]*?\S)\$(?!\d)/g, (match, prefix, p1) => {
60366036
let content = p1;
60376037
content = unescape_html(content);
60386038
if(content.replace(/\s+/g, '').match(/^\${1,}$/)) //only dollar signs, just return
60396039
{
60406040
return match;
60416041
}
6042-
return " "+temml.renderToString(content); // render LaTeX content
6042+
return prefix+temml.renderToString(content); // render LaTeX content
60436043
});
6044-
input = input.replace(/(?:^|[^\\])\$ (\S[^$\n$]*?\S) \$(?!\d)/g, (match, p1) => { //special version that handles a single space on both sides
6044+
input = input.replace(/(^|[^\\])\$([A-Za-z0-9])\$(?!\d)/g, (match, prefix, p1) => { //single letter or number
60456045
let content = p1;
60466046
content = unescape_html(content);
60476047
if(content.replace(/\s+/g, '').match(/^\${1,}$/)) //only dollar signs, just return
60486048
{
60496049
return match;
60506050
}
6051-
return " "+temml.renderToString(content); // render LaTeX content
6051+
return prefix+temml.renderToString(content); // render LaTeX content
6052+
});
6053+
input = input.replace(/(^|[^\\])\$ (\S[^$\n]*?) \$(?!\d)/g, (match, prefix, p1) => { //special version that handles a single space on both sides
6054+
let content = p1;
6055+
content = unescape_html(content);
6056+
if(content.replace(/\s+/g, '').match(/^\${1,}$/)) //only dollar signs, just return
6057+
{
6058+
return match;
6059+
}
6060+
return prefix+temml.renderToString(content); // render LaTeX content
60526061
});
60536062
input = input.replace(/(^\\begin\{math\}\n([\s\S]*?)\n\\end\{math\}$|^\\begin\{equation\}\n([\s\S]*?)\n\\end\{equation\}$)/gm, (match, p1, p2, p3) => { //match math eqns
60546063
let content = p2 || p3;

koboldcpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5835,7 +5835,7 @@ def save_config_gui():
58355835
export_vars()
58365836
savdict = json.loads(json.dumps(args.__dict__))
58375837
file_type = [("KoboldCpp Settings", "*.kcpps")]
5838-
filename = zentk_asksaveasfilename(filetypes=file_type, defaultextension=".kcpps")
5838+
filename = zentk_asksaveasfilename(filetypes=file_type, defaultextension=".kcpps",title="Save kcpps settings config file")
58395839
if not filename:
58405840
return
58415841
filenamestr = str(filename).strip()

otherarch/tts_adapter.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ bool ttstype_load_model(const tts_load_model_inputs inputs)
557557

558558
// tts init
559559
if (is_ttscpp_file) {
560-
ttscpp_config = new generation_configuration("am_adam", 50, 1.0, 1.0, true, "", 0, 1.0);
560+
ttscpp_config = new generation_configuration("am_adam", 50, 1.0, 1.0, true, "", 1024, 1.0);
561561
ttscpp_runner = runner_from_file(modelfile_ttc, inputs.threads, ttscpp_config, true);
562562
if (ttscpp_runner == nullptr) {
563563
printf("\nTTS Load Error: Failed to initialize TTSCPP!\n");
@@ -681,12 +681,16 @@ static tts_generation_outputs ttstype_generate_ttscpp(const tts_generation_input
681681
}
682682
ttscpp_config->voice = voiceused;
683683

684+
if(!tts_is_quiet)
685+
{
686+
printf("\nTTS Generating...");
687+
}
684688
tts_response response_data;
685689
int errorres = generate(ttscpp_runner, prompt, &response_data, ttscpp_config);
686690
if(errorres==0)
687691
{
688692
ttstime = timer_check();
689-
printf("\nTTS Generated %d audio in %.2fs.\n",ttstime);
693+
printf("\nTTS Generated audio in %.2fs.\n",ttstime);
690694
std::vector<float> wavdat = std::vector(response_data.data, response_data.data + response_data.n_outputs);
691695
last_generated_audio = save_wav16_base64(wavdat, ttscpp_runner->sampling_rate);
692696
output.data = last_generated_audio.c_str();

otherarch/ttscpp/src/dia_model.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
void dia_model::assign_weight(std::string name, struct ggml_tensor * tensor) {
44
std::vector<std::string> parts = split(name, ".");
5+
// GGML_LOG("\nassign_weight %s\n",name.c_str());
6+
if(name=="GGUF tensor data binary blob") //patch for gguf, idk why this tensor exists
7+
{
8+
return;
9+
}
510
TTS_ASSERT(parts.size() >= 3);
611

712
if (parts[1] == "encoder") {

0 commit comments

Comments
 (0)