This commit is contained in:
Vinesh Janarthanan 2024-09-11 10:52:55 -05:00 committed by GitHub
commit 6af1a9d0fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2592,10 +2592,10 @@ int main(int argc, char ** argv) {
return false;
};
auto middleware_server_state = [&res_error, &state](const httplib::Request &, httplib::Response & res) {
auto middleware_server_state = [&state](const httplib::Request &, httplib::Response & res) {
server_state current_state = state.load();
if (current_state == SERVER_STATE_LOADING_MODEL) {
res_error(res, format_error_response("Loading model", ERROR_TYPE_UNAVAILABLE));
res.set_content("<html><body>The model is loading. Please wait.<br/>The user interface will appear soon.</body></html>", "text/html; charset=utf-8");
return false;
}
return true;