Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/common/assistant_code_interpreter_tool.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct AssistantCodeInterpreterTool : public AssistantTool {

static cpp::result<AssistantCodeInterpreterTool, std::string> FromJson() {
AssistantCodeInterpreterTool tool;
return std::move(tool);
return tool;
}

cpp::result<Json::Value, std::string> ToJson() override {
Expand Down
2 changes: 2 additions & 0 deletions engine/common/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ struct Thread : JsonSerializable {
if (auto code_interpreter =
dynamic_cast<CodeInterpreter*>(tool_resources.get())) {
tool_json["code_interpreter"] = tool_result.value();
(void) code_interpreter;
} else if (auto file_search =
dynamic_cast<FileSearch*>(tool_resources.get())) {
tool_json["file_search"] = tool_result.value();
(void) file_search;
}
json["tool_resources"] = tool_json;
}
Expand Down
13 changes: 10 additions & 3 deletions engine/extensions/python-engine/python_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ size_t StreamWriteCallback(char* ptr, size_t size, size_t nmemb,
return size * nmemb;
}

static size_t WriteCallback(char* ptr, size_t size, size_t nmemb,
[[maybe_unused]] static size_t WriteCallback(char* ptr, size_t size, size_t nmemb,
std::string* data) {
data->append(ptr, size * nmemb);
return size * nmemb;
Expand Down Expand Up @@ -185,6 +185,7 @@ void PythonEngine::GetModels(
status["status_code"] = k200OK;

callback(std::move(status), std::move(response_json));
(void) json_body;
}

void PythonEngine::LoadModel(
Expand Down Expand Up @@ -386,6 +387,8 @@ void PythonEngine::HandleChatCompletion(
std::shared_ptr<Json::Value> json_body,
std::function<void(Json::Value&&, Json::Value&&)>&& callback) {
LOG_WARN << "Does not support yet!";
(void) json_body;
(void) callback;
}

CurlResponse PythonEngine::MakeStreamPostRequest(
Expand Down Expand Up @@ -623,7 +626,9 @@ Json::Value PythonEngine::GetRemoteModels() {
return Json::Value();
}

void PythonEngine::StopInferencing(const std::string& model_id) {}
void PythonEngine::StopInferencing(const std::string& model_id) {
(void)model_id;
}

void PythonEngine::HandleRouteRequest(
std::shared_ptr<Json::Value> json_body,
Expand Down Expand Up @@ -893,12 +898,14 @@ void PythonEngine::SetLogLevel(trantor::Logger::LogLevel log_level) {

void PythonEngine::Load(EngineLoadOption opts) {
// Develop register model here on loading engine
(void) opts;
};

void PythonEngine::Unload(EngineUnloadOption opts) {
for (const auto& pair : models_) {
TerminateModelProcess(pair.first);
}
(void) opts;
};

} // namespace python_engine
} // namespace python_engine
4 changes: 2 additions & 2 deletions engine/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void RunServer(std::optional<std::string> host, std::optional<int> port,
bool ignore_cout) {
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
auto signal_handler = +[](int sig) -> void {
std::cout << "\rCaught interrupt signal, shutting down\n";
std::cout << "\rCaught interrupt signal:" << sig << ", shutting down\n";;
shutdown_signal = true;
};
signal(SIGINT, signal_handler);
Expand Down Expand Up @@ -145,7 +145,7 @@ void RunServer(std::optional<std::string> host, std::optional<int> port,
return;
}

using Event = cortex::event::Event;
// using Event = cortex::event::Event; //unused
using EventQueue =
eventpp::EventQueue<EventType,
void(const eventpp::AnyData<eventMaxSize>&)>;
Expand Down
2 changes: 2 additions & 0 deletions engine/services/download_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ class DownloadService {
break;
}
}
(void) ultotal;
(void) ulnow;

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions engine/utils/cortex_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ inline std::string logs_cli_base_name = "./logs/cortex-cli.log";
// example: Mon, 25 Nov 2024 09:57:03 GMT
inline std::string GetDateRFC1123() {
std::time_t now = std::time(nullptr);
std::tm gmt_time = {};
#ifdef _MSC_VER
std::tm gmt_time = {};
gmtime_s(&gmt_time, &now);
std::ostringstream oss;
oss << std::put_time(&gmt_time, "%a, %d %b %Y %H:%M:%S GMT");
Expand Down Expand Up @@ -133,7 +133,7 @@ inline std::string GetCurrentPath() {
#else
std::vector<char> buf(PATH_MAX);
ssize_t len = readlink("/proc/self/exe", &buf[0], buf.size());
if (len == -1 || len == buf.size()) {
if (len == -1 || len == (ssize_t) buf.size()) {
std::cerr << "Error reading symlink /proc/self/exe." << std::endl;
return "";
}
Expand Down
2 changes: 1 addition & 1 deletion engine/utils/file_logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void FileLogger::CircularLogFile::writeLog(const char* logLine,
lineBuffer_.push_back(line);
AppendToFile(line + "\n");
++linesWrittenSinceLastTruncate_;
if (linesWrittenSinceLastTruncate_.load() >= TRUNCATE_CHECK_INTERVAL) {
if (static_cast<uint64_t>(linesWrittenSinceLastTruncate_.load()) >= TRUNCATE_CHECK_INTERVAL) {

TruncateFileIfNeeded();
}
Expand Down
1 change: 1 addition & 0 deletions engine/utils/github_release_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ inline cpp::result<std::vector<GitHubRelease>, std::string> GetReleases(
for (const auto& release : result.value()) {
releases.push_back(GitHubRelease::FromJson(release));
}
(void) allow_prerelease;
return releases;
}

Expand Down
1 change: 1 addition & 0 deletions engine/utils/hardware/gguf/gguf_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ inline std::optional<GGUFFile> ParseGgufFile(const std::string& path) {
}
gf.tensor_infos = tis;
}
(void) version;
return gf;
}
} // namespace hardware
2 changes: 1 addition & 1 deletion engine/utils/url_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ inline cpp::result<Url, std::string> FromUrlString(
.host = "",
.pathParams = {},
};
unsigned counter = 0;
int counter = 0;

std::smatch url_match_result;

Expand Down
Loading