Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions LLama/Abstractions/IModelParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
Expand Down Expand Up @@ -272,11 +273,11 @@ internal void WriteValue(ref LLamaModelMetadataOverride dest)
dest.BoolValue = _valueBool ? -1L : 0;
break;
default:
throw new ArgumentOutOfRangeException();
throw new InvalidEnumArgumentException($"Unknown {nameof(LLamaModelKvOverrideType)} value: {Type}");
}
}

internal void WriteValue(Utf8JsonWriter writer, JsonSerializerOptions options)
internal void WriteValue(Utf8JsonWriter writer)
{
switch (Type)
{
Expand All @@ -290,7 +291,7 @@ internal void WriteValue(Utf8JsonWriter writer, JsonSerializerOptions options)
writer.WriteBooleanValue(_valueBool);
break;
default:
throw new ArgumentOutOfRangeException();
throw new InvalidEnumArgumentException($"Unknown {nameof(LLamaModelKvOverrideType)} value: {Type}");
}
}
}
Expand Down Expand Up @@ -323,7 +324,7 @@ public override void Write(Utf8JsonWriter writer, MetadataOverride value, JsonSe
writer.WriteNumber("Type", (int)value.Type);
writer.WriteString("Key", value.Key);
writer.WritePropertyName("Value");
value.WriteValue(writer, options);
value.WriteValue(writer);
}
writer.WriteEndObject();
}
Expand Down