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
3 changes: 2 additions & 1 deletion engine/database/models.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ cpp::result<std::vector<ModelEntry>, std::string> Models::GetModelSources()
"SELECT model_id, author_repo_id, branch_name, "
"path_to_model_yaml, model_alias, model_format, "
"model_source, status, engine, metadata FROM models "
"WHERE model_source != \"\" AND (status = \"downloaded\" OR status = "
"WHERE model_source != \"\" AND model_source != \"imported\" AND "
"(status = \"downloaded\" OR status = "
"\"downloadable\")");
while (query.executeStep()) {
ModelEntry entry;
Expand Down
17 changes: 12 additions & 5 deletions engine/extensions/remote-engine/remote_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ size_t StreamWriteCallback(char* ptr, size_t size, size_t nmemb,
Json::Value check_error;
Json::Reader reader;
context->chunks += chunk;
if (reader.parse(context->chunks, check_error) ||
(reader.parse(chunk, check_error) &&
chunk.find("error") != std::string::npos)) {

long http_code = k200OK;
if (context->curl) {
curl_easy_getinfo(context->curl, CURLINFO_RESPONSE_CODE, &http_code);
}
if (http_code != k200OK && (reader.parse(context->chunks, check_error) ||
(chunk.find("error") != std::string::npos &&
reader.parse(chunk, check_error)))) {
CTL_WRN(context->chunks);
CTL_WRN(chunk);
CTL_WRN("http code: " << http_code << " - " << chunk);
CTL_INF("Request: " << context->last_request);
Json::Value status;
status["is_done"] = true;
Expand Down Expand Up @@ -139,7 +144,9 @@ CurlResponse RemoteEngine::MakeStreamingChatCompletionRequest(
renderer_,
stream_template,
true,
body};
body,
"",
curl};

curl_easy_setopt(curl, CURLOPT_URL, full_url.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
Expand Down
1 change: 1 addition & 0 deletions engine/extensions/remote-engine/remote_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct StreamContext {
bool need_stop = true;
std::string last_request;
std::string chunks;
CURL* curl;
};
struct CurlResponse {
std::string body;
Expand Down
2 changes: 1 addition & 1 deletion engine/services/model_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ ModelService::ModelService(std::shared_ptr<DatabaseService> db_service,
inference_svc_(inference_service),
engine_svc_(engine_svc),
task_queue_(task_queue) {
ProcessBgrTasks();
// ProcessBgrTasks();
};

void ModelService::ForceIndexingModelList() {
Expand Down
Loading