Skip to content

Commit 7811fc5

Browse files
authored
Merge pull request #43 from utilityai/send-sync-for-context-params
implemented Send + Sync for `LlamaContextParams`
2 parents 840412a + fdac4ac commit 7811fc5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llama-cpp-2/src/context/params.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ pub struct LlamaContextParams {
6969
pub(crate) context_params: llama_cpp_sys_2::llama_context_params,
7070
}
7171

72+
/// SAFETY: we do not currently allow setting or reading the pointers that cause this to not be automatically send or sync.
73+
unsafe impl Send for LlamaContextParams {}
74+
unsafe impl Sync for LlamaContextParams {}
75+
7276
impl LlamaContextParams {
7377
/// Set the seed of the context
7478
///

0 commit comments

Comments
 (0)