Added execution time to the UI

This commit is contained in:
ebolam 2022-06-10 20:51:22 -04:00
parent cfd1147d5a
commit 5110e956d2
3 changed files with 10 additions and 0 deletions

View File

@ -882,6 +882,7 @@ function formatChunkInnerText(chunk) {
} }
function dosubmit(disallow_abort) { function dosubmit(disallow_abort) {
submit_start = Date.now();
var txt = input_text.val().replace(/\u00a0/g, " "); var txt = input_text.val().replace(/\u00a0/g, " ");
if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) { if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) {
return; return;
@ -2099,6 +2100,10 @@ $(document).ready(function(){
scrollToBottom(); scrollToBottom();
} else if(msg.cmd == "updatechunk") { } else if(msg.cmd == "updatechunk") {
hideMessage(); hideMessage();
if (typeof submit_start !== 'undefined') {
$("#runtime")[0].innerHTML = `Generation time: ${Math.round((Date.now() - submit_start)/1000)} sec`;
delete submit_start;
}
var index = msg.data.index; var index = msg.data.index;
var html = msg.data.html; var html = msg.data.html;
var existingChunk = game_text.children('#n' + index); var existingChunk = game_text.children('#n' + index);

View File

@ -93,6 +93,7 @@
</div> </div>
<div id="connectstatusdiv" class="flex-row-container"> <div id="connectstatusdiv" class="flex-row-container">
<span id="connectstatus" class="color_orange flex-row">Waiting for connection...</span> <span id="connectstatus" class="color_orange flex-row">Waiting for connection...</span>
<div class="layer-container status-container flex-push-left" style="color: #FFFFFF;" id="runtime"></div>
<div class="layer-container status-container flex-push-right"> <div class="layer-container status-container flex-push-right">
<span class="oi oi-puzzle-piece statusicon layer-bottom" aria-hidden="true"> <span class="oi oi-puzzle-piece statusicon layer-bottom" aria-hidden="true">
<div class="statustext statustext-wide"> <div class="statustext statustext-wide">

View File

@ -150,6 +150,10 @@ def test_load_model_from_web_ui(client_data, model, expected_load_options):
generate_story_data(client_data) generate_story_data(client_data)
def test_load_GooseAI_from_web_ui(client_data):
pytest.skip("unsupported configuration")
@pytest.mark.parametrize("model, expected_load_options", test_models) @pytest.mark.parametrize("model, expected_load_options", test_models)
def test_load_model_from_command_line(client_data, model, expected_load_options): def test_load_model_from_command_line(client_data, model, expected_load_options):
(client, app, socketio_client) = client_data (client, app, socketio_client) = client_data