Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit d187eca

Browse files
committed
test
1 parent 77e173f commit d187eca

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

engine/services/inference_service.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@ cpp::result<void, InferResult> InferenceService::HandleChatCompletion(
2828
}
2929

3030
{
31-
if (json_body->isMember("files") && !(*json_body)["files"].empty()) {
32-
auto file = (*json_body)["files"][0].asString();
31+
// TODO: we can cache this one so we don't have to read the file every inference
32+
CTL_INF("Try to render chat_template");
33+
auto model_id = json_body->get("model", "").asString();
34+
if (!model_id.empty()) {
35+
auto file =
36+
"models/huggingface.co/bartowski/QwQ-32B-Preview-GGUF/"
37+
"QwQ-32B-Preview-Q4_0.gguf";
38+
39+
// auto file = (*json_body)["files"][0].asString();
3340
auto model_metadata_res = cortex_utils::ReadGgufMetadata(
3441
file_manager_utils::ToAbsoluteCortexDataPath(
3542
std::filesystem::path(file)));
@@ -56,6 +63,8 @@ cpp::result<void, InferResult> InferenceService::HandleChatCompletion(
5663
CTL_ERR("Failed to render prompt: " + prompt_result.error());
5764
}
5865
}
66+
} else {
67+
CTL_ERR("Failed to read metadata: " + model_metadata_res.error());
5968
}
6069
}
6170
}

0 commit comments

Comments
 (0)