Skip to content

Commit f5123bf

Browse files
authored
fix: duplicate backend library files (#541)
1 parent 734693d commit f5123bf

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

llama/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ endif()
4040

4141
add_definitions(-DNAPI_VERSION=7)
4242
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
43+
set(CMAKE_PLATFORM_NO_VERSIONED_SONAME ON)
4344

4445
set(LLAMA_BUILD_COMMON ON)
4546

llama/addon/globals/addonLog.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ void addonLlamaCppLogCallback(ggml_log_level level, const char* text, void* user
9494
}
9595

9696
Napi::Value setLogger(const Napi::CallbackInfo& info) {
97-
if (info.Length() < 1 || !info[0].IsFunction()) {
98-
if (addonJsLoggerCallbackSet) {
99-
addonJsLoggerCallbackSet = false;
100-
addonThreadSafeLoggerCallback.Release();
101-
}
97+
if (addonJsLoggerCallbackSet) {
98+
addonJsLoggerCallbackSet = false;
99+
addonThreadSafeLoggerCallback.Release();
100+
}
102101

102+
if (info.Length() < 1 || !info[0].IsFunction()) {
103103
return info.Env().Undefined();
104104
}
105105

llama/cmake/addVariantSuffix.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function(addVariantSuffix originalTarget variantSuffix)
2-
if (NOT TARGET ${originalTarget} OR variantSuffix STREQUAL "")
2+
if (NOT TARGET ${originalTarget} OR ${variantSuffix} STREQUAL "")
33
return()
44
endif()
55

src/bindings/Llama.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class Llama {
137137
this._supportsMmap = bindings.getSupportsMmap();
138138
this._gpuSupportsMmap = bindings.getGpuSupportsMmap();
139139
this._supportsMlock = bindings.getSupportsMlock();
140-
this._mathCores = bindings.getMathCores();
140+
this._mathCores = Math.floor(bindings.getMathCores());
141141
this._consts = bindings.getConsts();
142142
this._vramOrchestrator = vramOrchestrator;
143143
this._vramPadding = vramPadding;
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {createBirpc} from "birpc";
22

33
export function createRendererSideBirpc<
4-
const RendererFunction = Record<string, never>,
5-
const ElectronFunctions extends object = Record<string, never>
4+
const ElectronFunction = Record<string, never>,
5+
const RendererFunctions extends object = Record<string, never>
66
>(
77
toRendererEventName: string,
88
fromRendererEventName: string,
9-
electronFunctions: ElectronFunctions
9+
rendererFunctions: RendererFunctions
1010
) {
11-
return createBirpc<RendererFunction, ElectronFunctions>(electronFunctions, {
11+
return createBirpc<ElectronFunction, RendererFunctions>(rendererFunctions, {
1212
post: (data) => window.ipcRenderer.send(fromRendererEventName, data),
1313
on: (onData) => window.ipcRenderer.on(toRendererEventName, (event, data) => {
1414
onData(data);
@@ -17,4 +17,3 @@ export function createRendererSideBirpc<
1717
deserialize: (value) => JSON.parse(value)
1818
});
1919
}
20-

test/modelDependent/llama3.2/sequenceState.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ describe("llama 3.2", () => {
169169
await contextSequence2.loadStateFromFile(stateFile1Path, {acceptRisk: true});
170170

171171
const res2 = await chatSession2.prompt("What did I tell you to remember?", {maxTokens: 12});
172-
expect(res2).to.toMatchInlineSnapshot('"You told me to remember that "locks are not doors"."');
172+
expect(res2).toMatch(/^(You told me to remember that "locks are not doors".|You told me to remember that "locks are not doors.")/);
173173
const contextSequence2TokensState = contextSequence2.tokenMeter.getState();
174174
expect(contextSequence2TokensState.usedInputTokens).to.be.lessThan(contextSequence1TokensState.usedInputTokens);
175175
expect(contextSequence2TokensState).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)