Skip to content

Commit

Permalink
Merge pull request #43 from utilityai/send-sync-for-context-params
Browse files Browse the repository at this point in the history
implemented Send + Sync for `LlamaContextParams`
  • Loading branch information
MarcusDunn authored Jan 24, 2024
2 parents 840412a + fdac4ac commit 7811fc5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llama-cpp-2/src/context/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ pub struct LlamaContextParams {
pub(crate) context_params: llama_cpp_sys_2::llama_context_params,
}

/// SAFETY: we do not currently allow setting or reading the pointers that cause this to not be automatically send or sync.
unsafe impl Send for LlamaContextParams {}
unsafe impl Sync for LlamaContextParams {}

impl LlamaContextParams {
/// Set the seed of the context
///
Expand Down

0 comments on commit 7811fc5

Please sign in to comment.