mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-10-03 03:25:40 +00:00
fix audio gen ui, fix finish reason
This commit is contained in:
parent
a8b0069fac
commit
a5ca9da631
2 changed files with 20 additions and 2 deletions
|
|
@ -890,7 +890,7 @@ function loadTrack(id, callback) {
|
|||
showMessage("No JSON data found.");
|
||||
return;
|
||||
}
|
||||
callback(item.params);
|
||||
callback(item.params, item);
|
||||
};
|
||||
|
||||
req.onerror = function(){
|
||||
|
|
@ -899,7 +899,14 @@ function loadTrack(id, callback) {
|
|||
}
|
||||
|
||||
function loadTrackJSON(id){
|
||||
loadTrack(id, updateForm);
|
||||
loadTrack(id, function(data, item) {
|
||||
// Empty values are omitted from saved params, so clear audio codes before
|
||||
// applying the loaded song to avoid reusing codes from another track.
|
||||
if(item.type !== "tts") {
|
||||
document.getElementById("audio_codes").value = "";
|
||||
}
|
||||
updateForm(data);
|
||||
});
|
||||
}
|
||||
|
||||
function exportTrackJSON(id, title) {
|
||||
|
|
|
|||
11
koboldcpp.py
11
koboldcpp.py
|
|
@ -7999,6 +7999,17 @@ Change Mode<br>
|
|||
"choices": [{"index": 0, "finish_reason": "tool_calls" if (len(toolsdata_res) > 0) else currfinishreason, "delta": {}}]
|
||||
})
|
||||
self.wfile.write(f"data: {chunk_final}\n\n".encode())
|
||||
strop = genparams.get("stream_options", None)
|
||||
if strop and strop.get("include_usage", False):
|
||||
chunk_usage = json.dumps({
|
||||
"id": "koboldcpp",
|
||||
"object": "chat.completion.chunk",
|
||||
"created": int(time.time()),
|
||||
"model": modelNameToReturn,
|
||||
"choices": [],
|
||||
"usage": gendat["usage"]
|
||||
})
|
||||
self.wfile.write(f"data: {chunk_usage}\n\n".encode())
|
||||
self.wfile.write("data: [DONE]\n\n".encode())
|
||||
self.wfile.flush()
|
||||
self.close_connection = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue