Skip to content

Commit eeb8c8f

Browse files
committed
Use unsafe type directly for -ot field in LLamaModelParams, part 2
1 parent d2607ac commit eeb8c8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

LLama/Native/LLamaTensorBufferOverrideHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public unsafe void ApplyToModelParams(ref LLamaModelParams modelParams)
9090
{
9191
if (_overrides.Count == 0)
9292
{
93-
modelParams.tensor_buft_overrides = IntPtr.Zero;
93+
modelParams.tensor_buft_overrides = null;
9494
return;
9595
}
9696

@@ -117,7 +117,7 @@ public unsafe void ApplyToModelParams(ref LLamaModelParams modelParams)
117117
Marshal.StructureToPtr(new LLamaModelTensorBufferOverride { Pattern = IntPtr.Zero, BufferType = IntPtr.Zero }, nullTermPtr, false);
118118

119119
// Update model params
120-
modelParams.tensor_buft_overrides = _overrideArray;
120+
modelParams.tensor_buft_overrides = (LLamaModelTensorBufferOverride*)_overrideArray.ToPointer();
121121
}
122122

123123
/// <inheritdoc />

0 commit comments

Comments
 (0)