Skip to content

Commit

Permalink
dynatemp wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Jan 9, 2024
1 parent 550829e commit 5cc64eb
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 5 deletions.
54 changes: 52 additions & 2 deletions klite.embd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It requires no dependencies, installation or setup.
Just copy this single static HTML file anywhere and open it in a browser, or from a webserver.
Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite.
Kobold Lite is under the AGPL v3.0 License unless otherwise exempted. Please do not remove this line.
Current version: 104
Current version: 105
-Concedo
-->

Expand Down Expand Up @@ -5946,6 +5946,30 @@ Current version: 104
document.getElementById("advancedloadfile").classList.add("hidden");
}

function confirm_dynatemp()
{
let a1 = parseFloat(document.getElementById("dynatemp_min").value);
let a2 = parseFloat(document.getElementById("dynatemp_max").value);
let avg = (a1+a2)*0.5;
let diff = Math.abs(a2 - a1)*0.5;
document.getElementById("temperature").value = avg.toFixed(3);
document.getElementById("dynatemp_range").value = diff.toFixed(3);

document.getElementById("dynatempcontainer").classList.add("hidden");
}
function show_dynatemp()
{
let currtmp = parseFloat(document.getElementById("temperature").value);
let currrng = parseFloat(document.getElementById("dynatemp_range").value);
let a1 = currtmp - currrng;
let a2 = currtmp + currrng;
a1 = a1<0?0:a1;
a2 = a2<0?0:a2;
document.getElementById("dynatemp_min").value = a1.toFixed(2);
document.getElementById("dynatemp_max").value = a2.toFixed(2);
document.getElementById("dynatempcontainer").classList.remove("hidden");
}

function explain_horde()
{
msgbox("The AI Horde generates text using crowdsourced GPUs by volunteer workers. By default your inputs are not logged, but as Horde workers are open source, they can be modified to do so. <br><br>In all cases, the sender will *always be anonymous*, however you are still advised to avoid sending privacy sensitive information.<br><br>For any issues, you can find us on discord at <a class=\"color_blueurl\" href=\"https://koboldai.org/discord\">https://koboldai.org/discord</a>","Disclaimer",true);
Expand Down Expand Up @@ -12510,7 +12534,7 @@ Current version: 104
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
id="presence_penalty"></td>
<td><input class="" type="text" inputmode="decimal" placeholder="0" value="0"
id="dynatemp_range"></td>
id="dynatemp_range" ><button type="button" class="btn btn-primary" style="padding:1px 3px;font-size:8px;" onclick="show_dynatemp()">Help</button></td>
</tr>


Expand Down Expand Up @@ -12954,6 +12978,32 @@ Current version: 104
</div>
</div>

<div class="popupcontainer flex hidden" id="dynatempcontainer">
<div class="popupbg flex"></div>
<div class="nspopup fixsize">
<div class="popuptitlebar">
<div class="popuptitletext">Dynamic Temperature Wizard</div>
</div>
<div class="inlinelabel">
Dynamic temperature is specified by a Temperature Value and a Temperature Range. Actual temperature is allowed to be automatically adjusted dynamically between (DynaTemp ± DynaRange).<br><br>
For ease of use, a simple converter is provided here. Setting both values to the same temperature disables DynaTemp.<br><br>
</div>

<div class="inlinelabel">
<div class="justifyleft" style="padding:4px">Minimum Temperature: </div>
<input type="text" inputmode="decimal" id="dynatemp_min" style="width:60px">
</div>
<div class="inlinelabel">
<div class="justifyleft" style="padding:4px">Maximum Temperature: </div>
<input type="text" inputmode="decimal" id="dynatemp_max" style="width:60px">
</div>

<div class="popupfooter">
<button type="button" class="btn btn-primary" onclick="confirm_dynatemp()">Ok</button>
</div>
</div>
</div>

<div class="popupcontainer flex hidden" id="imagestylecontainer">
<div class="popupbg flex"></div>
<div class="nspopup fixsize">
Expand Down
4 changes: 2 additions & 2 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2153,13 +2153,13 @@ def tunnel_reader():
print("Cloudflared file exists, reusing it...")
else:
print("Downloading Cloudflare Tunnel for Windows...")
subprocess.run("curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -o cloudflared.exe", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
subprocess.run("curl -fL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -o cloudflared.exe", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
else:
if os.path.exists("cloudflared-linux-amd64") and os.path.getsize("cloudflared-linux-amd64") > 100000:
print("Cloudflared file exists, reusing it...")
else:
print("Downloading Cloudflare Tunnel for Linux...")
subprocess.run("curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared-linux-amd64", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
subprocess.run("curl -fL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared-linux-amd64", shell=True, capture_output=True, text=True, check=True, encoding='utf-8')
subprocess.run("chmod +x 'cloudflared-linux-amd64'", shell=True)
tunnel_thread = threading.Thread(target=run_tunnel)
tunnel_thread.start()
Expand Down
3 changes: 2 additions & 1 deletion llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11185,7 +11185,8 @@ int32_t llama_token_to_piece(const struct llama_model * model, llama_token token
} else if (llama_is_control_token(model->vocab, token)) {
;
} else {
GGML_ASSERT_CONTINUE(false);
//just hide invalid tokens
//GGML_ASSERT_CONTINUE(false);
}
break;
}
Expand Down

0 comments on commit 5cc64eb

Please sign in to comment.