|
|
@ -1381,7 +1381,7 @@ void init(void)
|
|
|
|
#ifdef WEB
|
|
|
|
#ifdef WEB
|
|
|
|
EM_ASM( {
|
|
|
|
EM_ASM( {
|
|
|
|
set_server_url(UTF8ToString($0));
|
|
|
|
set_server_url(UTF8ToString($0));
|
|
|
|
}, SERVER_URL);
|
|
|
|
}, SERVER_DOMAIN );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEVTOOLS
|
|
|
|
#ifdef DEVTOOLS
|
|
|
@ -3773,7 +3773,7 @@ void frame(void)
|
|
|
|
#ifdef WEB
|
|
|
|
#ifdef WEB
|
|
|
|
// fire off generation request, save id
|
|
|
|
// fire off generation request, save id
|
|
|
|
MD_ArenaTemp scratch = MD_GetScratch(0, 0);
|
|
|
|
MD_ArenaTemp scratch = MD_GetScratch(0, 0);
|
|
|
|
MD_String8 terminated_completion_url = MD_S8Fmt(scratch.arena, "%s/completion\0", SERVER_URL);
|
|
|
|
MD_String8 terminated_completion_url = MD_S8Fmt(scratch.arena, "%s:%d/completion\0", SERVER_DOMAIN, SERVER_PORT);
|
|
|
|
int req_id = EM_ASM_INT( {
|
|
|
|
int req_id = EM_ASM_INT( {
|
|
|
|
return make_generation_request(UTF8ToString($1, $2), UTF8ToString($0));
|
|
|
|
return make_generation_request(UTF8ToString($1, $2), UTF8ToString($0));
|
|
|
|
}, terminated_completion_url.str, prompt_str.str, prompt_str.size);
|
|
|
|
}, terminated_completion_url.str, prompt_str.str, prompt_str.size);
|
|
|
|