Browse Source

Modified `TensorSplitsCollection` so it accepts any number of splits, as long as it doesn't exceed the number of supported devices

tags/v0.8.1
Martin Evans 2 years ago
parent
commit
e47431ed80
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      LLama/Abstractions/IModelParams.cs

+ 4
- 3
LLama/Abstractions/IModelParams.cs View File

@@ -134,9 +134,10 @@ namespace LLama.Abstractions
/// <exception cref="ArgumentException"></exception>
public TensorSplitsCollection(float[] splits)
{
if (splits.Length != Splits.Length)
throw new ArgumentException($"tensor splits length must equal {Splits.Length}");
Splits = splits;
if (splits.Length > Splits.Length)
throw new ArgumentException($"Must supply at most {Splits.Length} tensor splits", nameof(splits));

splits.CopyTo(Splits.AsSpan());
}

/// <summary>


Loading…
Cancel
Save