Merge pull request #368 from martindevans/context_set_seed

Context Set Seed
This commit is contained in:
Martin Evans 2023-12-15 23:42:47 +00:00 committed by GitHub
commit c298ab828a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -86,6 +86,15 @@ namespace LLama
NativeHandle = SafeLLamaContextHandle.Create(model.NativeHandle, lparams);
}
/// <summary>
/// Set the seed for the RNG
/// </summary>
/// <param name="seed"></param>
public void SetSeed(uint seed)
{
NativeHandle.SetSeed(seed);
}
/// <summary>
/// Tokenize a string.
/// </summary>

View File

@ -283,5 +283,14 @@ namespace LLama.Native
}
}
#endregion
/// <summary>
/// Set the RNG seed
/// </summary>
/// <param name="seed"></param>
public void SetSeed(uint seed)
{
NativeApi.llama_set_rng_seed(this, seed);
}
}
}