File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1440,6 +1440,7 @@ llama-server: \
14401440	examples/server/system-prompts.js.hpp \ 
14411441	examples/server/prompt-formats.js.hpp \ 
14421442	examples/server/json-schema-to-grammar.mjs.hpp \ 
1443+ 	examples/server/loading.html.hpp \ 
14431444	common/json.hpp \ 
14441445	common/stb_image.h \ 
14451446	$(OBJ_ALL ) 
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ set(PUBLIC_ASSETS
3030    system -prompts.js
3131    prompt-formats.js
3232    json-schema-to-grammar.mjs
33+     loading.html
3334)
3435
3536foreach (asset ${PUBLIC_ASSETS} )
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>  
2+ < html > 
3+     < head > 
4+         < meta  http-equiv ="refresh " content ="5 "> 
5+     </ head > 
6+     < body > 
7+         < div  id ="loading "> 
8+             The model is loading. Please wait.< br /> 
9+             The user interface will appear soon.
10+         </ div > 
11+     </ body > 
12+ </ html > 
Original file line number Diff line number Diff line change 2828#include  " system-prompts.js.hpp" 
2929#include  " prompt-formats.js.hpp" 
3030#include  " json-schema-to-grammar.mjs.hpp" 
31+ #include  " loading.html.hpp" 
3132
3233#include  < atomic> 
3334#include  < chrono> 
@@ -2595,8 +2596,9 @@ int main(int argc, char ** argv) {
25952596    auto  middleware_server_state = [&res_error, &state](const  httplib::Request & req, httplib::Response & res) {
25962597        server_state current_state = state.load ();
25972598        if  (current_state == SERVER_STATE_LOADING_MODEL) {
2598-             if (req.path  == " /" 
2599-                 res.set_content (" <html><body>The model is loading. Please wait.<br/>The user interface will appear soon.<br/>You may need to refresh the page.</body></html>" " text/html; charset=utf-8" 
2599+             auto  tmp = string_split (req.path , ' .' 
2600+             if  (req.path  == " /" back () == " html" 
2601+                 res.set_content (reinterpret_cast <const  char *>(loading_html), loading_html_len, " text/html; charset=utf-8" 
26002602                res.status  = 503 ;
26012603            } else  {
26022604                res_error (res, format_error_response (" Loading model" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments