Skip to content

Commit

Permalink
fix: electron build is broken on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Jul 24, 2024
1 parent 73e631b commit a784e80
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
20 changes: 12 additions & 8 deletions cortex-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ project(cortex-cpp C CXX)

# Build using CMAKE-JS
if(DEFINED CMAKE_JS_INC)
if(WIN32)
add_definitions(
-DV8_COMPRESS_POINTERS
-DV8_REVERSE_JSARGS
-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
)
endif()
include_directories(${CMAKE_JS_INC})
endif()

Expand Down Expand Up @@ -84,14 +86,16 @@ if(DEFINED CMAKE_JS_INC)
${CMAKE_JS_SRC}
)

target_link_libraries(${PROJECT_NAME}
PRIVATE
msvcprt.lib
msvcrt.lib
vcruntime.lib
ucrt.lib
${CMAKE_JS_LIB}
)
if(WIN32)
target_link_libraries(${PROJECT_NAME}
PRIVATE
msvcprt.lib
msvcrt.lib
vcruntime.lib
ucrt.lib
${CMAKE_JS_LIB}
)
endif()
else() # Official build
add_executable(${PROJECT_NAME} main.cc
${CMAKE_CURRENT_SOURCE_DIR}/utils/cpuid/cpu_info.cc
Expand Down
2 changes: 1 addition & 1 deletion cortex-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cli-progress": "^3.12.0",
"cortex-cpp": "0.4.25",
"cortex-cpp": "0.4.34",
"cortexso-node": "^0.0.4",
"cpu-instructions": "^0.0.11",
"decompress": "^4.2.1",
Expand Down
5 changes: 4 additions & 1 deletion cortex-js/src/usecases/chat/chat.usecases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export class ChatUsecases {
throw new Error(`No engine found with name: ${model.engine}`);
}
try {
return await engine.inference(createChatDto, headers);
return await engine.inference(
{ ...createChatDto, engine: model.engine },
headers,
);
} catch (error) {
await this.telemetryUseCases.createCrashReport(
error,
Expand Down

0 comments on commit a784e80

Please sign in to comment.