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

Commit 75d44ac

Browse files
Merge branch 'chore/model-run-docs-update' of github.com:janhq/cortex.cpp into chore/model-run-docs-update
2 parents e72eec2 + 301dbe1 commit 75d44ac

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ Cortex releases 2 preview versions for advanced users to try new features early
285285
#### Windows
286286

287287
1. Clone the Cortex.cpp repository [here](https://github.com/janhq/cortex.cpp).
288-
2. Navigate to the `engine > vcpkg` folder.
288+
2. Navigate to the `engine` folder.
289289
3. Configure the vpkg:
290290

291291
```bash
@@ -294,16 +294,16 @@ cd vcpkg
294294
vcpkg install
295295
```
296296

297-
4. Build the Cortex.cpp inside the `build` folder:
297+
4. Build the Cortex.cpp inside the `engine/build` folder:
298298

299299
```bash
300300
mkdir build
301301
cd build
302-
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_folder/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
302+
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_folder_in_cortex_repo/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
303+
cmake --build . --config Release
303304
```
304305

305-
5. Use Visual Studio with the C++ development kit to build the project using the files generated in the `build` folder.
306-
6. Verify that Cortex.cpp is installed correctly by getting help information.
306+
5. Verify that Cortex.cpp is installed correctly by getting help information.
307307

308308
```sh
309309
cortex -h
@@ -312,7 +312,7 @@ cortex -h
312312
#### MacOS
313313

314314
1. Clone the Cortex.cpp repository [here](https://github.com/janhq/cortex.cpp).
315-
2. Navigate to the `engine > vcpkg` folder.
315+
2. Navigate to the `engine` folder.
316316
3. Configure the vpkg:
317317

318318
```bash
@@ -321,17 +321,16 @@ cd vcpkg
321321
vcpkg install
322322
```
323323

324-
4. Build the Cortex.cpp inside the `build` folder:
324+
4. Build the Cortex.cpp inside the `engine/build` folder:
325325

326326
```bash
327327
mkdir build
328328
cd build
329-
cmake .. -DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_folder/vcpkg/scripts/buildsystems/vcpkg.cmake
329+
cmake .. -DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_folder_in_cortex_repo/vcpkg/scripts/buildsystems/vcpkg.cmake
330330
make -j4
331331
```
332332

333-
5. Use Visual Studio with the C++ development kit to build the project using the files generated in the `build` folder.
334-
6. Verify that Cortex.cpp is installed correctly by getting help information.
333+
5. Verify that Cortex.cpp is installed correctly by getting help information.
335334

336335
```sh
337336
cortex -h
@@ -340,7 +339,7 @@ cortex -h
340339
#### Linux
341340

342341
1. Clone the Cortex.cpp repository [here](https://github.com/janhq/cortex.cpp).
343-
2. Navigate to the `engine > vcpkg` folder.
342+
2. Navigate to the `engine` folder.
344343
3. Configure the vpkg:
345344

346345
```bash
@@ -349,17 +348,16 @@ cd vcpkg
349348
vcpkg install
350349
```
351350

352-
4. Build the Cortex.cpp inside the `build` folder:
351+
4. Build the Cortex.cpp inside the `engine/build` folder:
353352

354353
```bash
355354
mkdir build
356355
cd build
357-
cmake .. -DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_folder/vcpkg/scripts/buildsystems/vcpkg.cmake
356+
cmake .. -DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_folder_in_cortex_repo/vcpkg/scripts/buildsystems/vcpkg.cmake
358357
make -j4
359358
```
360359

361-
5. Use Visual Studio with the C++ development kit to build the project using the files generated in the `build` folder.
362-
6. Verify that Cortex.cpp is installed correctly by getting help information.
360+
5. Verify that Cortex.cpp is installed correctly by getting help information.
363361

364362
```sh
365363
cortex -h

engine/cli/commands/model_get_cmd.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "httplib.h"
99
#include "server_start_cmd.h"
1010
#include "utils/file_manager_utils.h"
11+
#include "utils/json_helper.h"
1112
#include "utils/logging_utils.h"
1213

1314
namespace commands {
@@ -30,7 +31,8 @@ void ModelGetCmd::Exec(const std::string& host, int port,
3031
if (res->status == httplib::StatusCode::OK_200) {
3132
CLI_LOG(res->body);
3233
} else {
33-
CTL_ERR("Model failed to get with status code: " << res->status);
34+
auto root = json_helper::ParseJsonString(res->body);
35+
CLI_LOG(root["message"].asString());
3436
}
3537
} else {
3638
auto err = res.error();

0 commit comments

Comments
 (0)