-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impelement sync / send for llama structs #481
Comments
I don't know if it is safe to implement either of those. A PR would be welcome if there's both a problem that cannot be solved without implementing them and an argument for why Send and Sync are safe to implement (I'm not nearly a good enough rust or c++ developer to be confident) I've had success with static's + message passing while writing a web server based on this library, it's not super elegant, but it certainly gets the job done. I'd be interested to know the usecase you're running into. |
I have a concrete use case :
|
pub model: &'a LlamaModel, |
That would avoid creating a bunch of wrappers and just use this library with threads.
@MarcusDunn does that make sense? Do you see any trap about doing that change?
I think, (although I'd have to reread some of the c++) that the change to an the I'm happy to be convinced otherwise. PR's + multithreaded / async example to show it doesn't all blow up are welcome. As mentioned in #483, I've used this library to create a very high performance inference server. Multithreading I think is a red herring when what you really want is batched decoding. It was an async web sever and I streamed output by turning a |
So I can use it across threads with Mutex.
The text was updated successfully, but these errors were encountered: