Python Binding #154
Replies: 1 comment 3 replies
-
Hey Omar, thank you. :) Yes, I did consider creating Python bindings from the Rust code but then decided against it. PyO3 does not yet support converting Rust enums to Python enums which would have resulted in a clumsy API. That's why I rewrote the library in pure Python to have a proper API. This way, I was also able to use NumPy arrays for storing the language models. NumPy arrays are very memory-efficient. All language models only consume about 700 MB in memory which is far less than with the other implementations in Rust, Go and Kotlin. While PyO3 evolves, I will re-evaluate regularly whether it makes sense to use PyO3 to replace the pure Python implementation. But I don't see that possibility in the near future. |
Beta Was this translation helpful? Give feedback.
-
Hey Peter,
Really love you work.
I was wondering if you ever considered creating a python binding by leveraging the performance of the rust version?
Best,
OM
Beta Was this translation helpful? Give feedback.
All reactions