https://github.com/manticoresoftware/php-ext-model
Sentence Transformer model inference with PHP and HuggingFace candle ML framework wrapper
https://github.com/manticoresoftware/php-ext-model
Last synced: 2 months ago
JSON representation
Sentence Transformer model inference with PHP and HuggingFace candle ML framework wrapper
- Host: GitHub
- URL: https://github.com/manticoresoftware/php-ext-model
- Owner: manticoresoftware
- Created: 2024-03-23T12:51:13.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T10:02:30.000Z (about 2 years ago)
- Last Synced: 2025-04-08T20:47:57.466Z (about 1 year ago)
- Language: Rust
- Size: 29.3 KB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php-ext-model
This extension enable you the power of rust and HuggingFace candle framework to run any setence-transformers model form the PHP with lighting speed.
## How to Use
Here's an example of how to use it:
```php
predict("Hello world"));
```
This will display the flatten tensor as list of floats
## How to Build
You need to have `cargo` installed to build.
```bash
cargo build --release
```
After the build is complete, you can use the extension with PHP as usual.
```bash
$ php -d extension=target/release/libphp_ext_model.so -r 'var_dump(class_exists("Manticore\Ext\Model"));'
bool(true)
```