Skip to content

Commit

Permalink
Fixed some comments saying a method throws RunTime when it actually t…
Browse files Browse the repository at this point in the history
…hrows a different exception
  • Loading branch information
martindevans committed Jul 31, 2024
1 parent 955404f commit 2a335d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions LLama/LLamaContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ public void LoadState(string filename, LLamaSeqId sequence)
/// Load the state from memory.
/// </summary>
/// <param name="state"></param>
/// <exception cref="RuntimeError"></exception>
public void LoadState(State state)
{
unsafe
Expand All @@ -364,7 +363,6 @@ public void LoadState(State state)
/// </summary>
/// <param name="state"></param>
/// <param name="sequence"></param>
/// <exception cref="RuntimeError"></exception>
public void LoadState(SequenceState state, LLamaSeqId sequence)
{
unsafe
Expand Down
4 changes: 2 additions & 2 deletions LLama/LLamaEmbedder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public LLamaEmbedder(LLamaWeights weights, IContextParams @params, ILogger? logg
/// <param name="text"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="RuntimeError"></exception>
/// <exception cref="LLamaDecodeError"></exception>
public Task<float[]> GetEmbeddings(string text, CancellationToken cancellationToken = default)
{
return GetEmbeddings(text, true, cancellationToken);
Expand All @@ -57,7 +57,7 @@ public Task<float[]> GetEmbeddings(string text, CancellationToken cancellationTo
/// <param name="addBos">Add bos to the text.</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="RuntimeError"></exception>
/// <exception cref="LLamaDecodeError"></exception>
public async Task<float[]> GetEmbeddings(string text, bool addBos, CancellationToken cancellationToken = default)
{
var tokens = Context.Tokenize(text, addBos);
Expand Down
4 changes: 3 additions & 1 deletion LLama/Native/SafeLlamaModelHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ protected override bool ReleaseHandle()
/// <param name="modelPath"></param>
/// <param name="lparams"></param>
/// <returns></returns>
/// <exception cref="RuntimeError"></exception>
/// <exception cref="InvalidOperationException"></exception>
/// <exception cref="LoadWeightsFailedException"></exception>
public static SafeLlamaModelHandle LoadFromFile(string modelPath, LLamaModelParams lparams)
{
// Try to open the model file, this will check:
Expand Down Expand Up @@ -443,6 +444,7 @@ private static int llama_model_meta_val_str(SafeLlamaModelHandle model, string k
/// <param name="modelBase">A path to a higher quality model to use as a base for the layers modified by the
/// adapter. Can be NULL to use the current loaded model.</param>
/// <param name="threads"></param>
/// <exception cref="InvalidOperationException"></exception>
/// <exception cref="RuntimeError"></exception>
public void ApplyLoraFromFile(string lora, float scale, string? modelBase = null, int? threads = null)
{
Expand Down
2 changes: 1 addition & 1 deletion LLama/Native/SafeLlavaModelHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override bool ReleaseHandle()
/// <param name="verbosity">Verbosity level</param>
/// <returns>SafeHandle of the Clip Model</returns>
/// <exception cref="InvalidOperationException"></exception>
/// <exception cref="RuntimeError"></exception>
/// <exception cref="LoadWeightsFailedException"></exception>
public static SafeLlavaModelHandle LoadFromFile(string modelPath, int verbosity )
{
// Try to open the model file, this will check:
Expand Down

0 comments on commit 2a335d0

Please sign in to comment.