candle/candle-pyo3
Laurent Mazare b20acd622c
Update for pyo3 0.21. (#1985)
* Update for pyo3 0.21.

* Also adapt the RL example.

* Fix for the pyo3-onnx bindings...

* Print details on failures.

* Revert pyi.
2024-04-01 17:07:02 +02:00
..
_additional_typing PyO3: Add `equal` and `__richcmp__` to `candle.Tensor` (#1099) 2023-10-30 15:17:28 +00:00
py_src/candle Update for pyo3 0.21. (#1985) 2024-04-01 17:07:02 +02:00
src Update for pyo3 0.21. (#1985) 2024-04-01 17:07:02 +02:00
tests Fix a couple typos (#1451) 2023-12-17 05:20:05 -06:00
.gitignore Make the Python Wrapper more Hackable and simplify Quantization (#1010) 2023-10-06 19:01:07 +01:00
Cargo.toml Update for pyo3 0.21. (#1985) 2024-04-01 17:07:02 +02:00
README.md Generate `*.pyi` stubs for PyO3 wrapper (#870) 2023-09-16 17:23:38 +01:00
build.rs Fix the pyo3 build for macos. (#324) 2023-08-05 14:53:57 +01:00
e5.py Use an attention mask in the e5 padding case. (#1085) 2023-10-13 18:53:40 +01:00
pyproject.toml Make the Python Wrapper more Hackable and simplify Quantization (#1010) 2023-10-06 19:01:07 +01:00
quant-llama.py Make the Python Wrapper more Hackable and simplify Quantization (#1010) 2023-10-06 19:01:07 +01:00
stub.py Update for pyo3 0.21. (#1985) 2024-04-01 17:07:02 +02:00
test.py Add support for accelerate in the pyo3 bindings. (#1167) 2023-10-24 06:34:37 +01:00
test_pytorch.py convert pytorch's tensor in Python API (#1172) 2023-10-25 19:39:14 +01:00

README.md

Installation

From the candle-pyo3 directory, enable a virtual env where you will want the candle package to be installed then run.

maturin develop -r 
python test.py

Generating Stub Files for Type Hinting

For type hinting support, the candle-pyo3 package requires *.pyi files. You can automatically generate these files using the stub.py script.

Steps:

  1. Install the package using maturin.
  2. Generate the stub files by running:
    python stub.py
    

Validation:

To ensure that the stub files match the current implementation, execute:

python stub.py --check