Releases: CodeWithKyrian/transformers-php
v0.6.2
What's Changed
- allow Symfony 8 components by @xabbuh in #94
- Using correct method to add command to CLI application by @CViniciusSDias in #93
- fix: PHP 8.4 nullable deprecations by @chr-hertel in #97
- Fix namespace conflict with Transformers class by @Flatroy in #91
New Contributors
- @xabbuh made their first contribution in #94
- @CViniciusSDias made their first contribution in #93
- @chr-hertel made their first contribution in #97
- @Flatroy made their first contribution in #91
Full Changelog: 0.6.1...0.6.2
0.6.1
What's New
- feat: update Rindow Matlib macOS binaries for ARM64 and x86_64 architectures
- fix: update darwin platform directory names
- chore(ci): clean up distribution directory after artifact creation in release workflow
Full Changelog: 0.6.0...0.6.1
v0.6.0
What’s Changed
- Add support for stopping criteria:
MaxLength,MaxTime, andInterruptablefor more flexible generation control. - Add PSR-3 logging support
- Extend
PretrainedConfigto reduce code repetition across model files and improve maintainability. - Restructure
AutoModelresolution to prioritize generic model selection when no task-specific class is found. - Add support for new model families:
Gemma,Gemma2,Gemma3,Qwen3, andPhi3, with their respective causal language models. - Add support for
eosandlast_tokenpooling strategies in theFeatureExtractionPipeline. - Add support for new merge format in
BPEModelwith better compatibility via JSON-encoded token pair mapping. - Introduce
PretrainedModel::$sessionsarray to streamline model session handling across subclasses. - Simplify streamer implementation to improve clarity and flexibility.
- Enhance image processing methods and VIPS integration.
- Convert to a platform package with native shared library support for Linux, macOS, and Windows (x86_64 and ARM64).
- Introduce dynamic shared library loading with platform-specific path resolution logic.
- Update example configurations, docs, and usage instructions to reflect new architecture.
- Add tests for image utilities and inference session logic.
Bug Fixes
- Fix
Tensor::slice()error during generation. - Fix logic in
RepetitionPenaltyLogitsProcessorto properly apply penalties based on generated tokens. - Fix compatibility issues with PHP 8.1 and adjust dependency versions accordingly.
- Fix bug in
HubTestfor Windows paths by usingDIRECTORY_SEPARATOR. - Fix edge case in
BPEModelwhen null value encountered in merge map. - Fix various doc inconsistencies and default constructor bugs in model subclasses.
Improvements
- Refactor library architecture for improved platform compatibility and modularity.
- Refactor
Samplerate,Sndfile, and other FFI wrappers to use instance-based invocation. - Improve generation configuration merging logic and model resolution flow.
- Unify code style across components and improve clarity of core components.
- Update shared native dependencies:
- onnxruntime → 1.21.0
- rindowmatlib → 1.1.1
- Clean up feature extractors and consolidate model session logic.
- Improve error handling in FFI calls and utility classes.
- Rename internal config and model mapping classes for better clarity (
PretrainedMixin→AutoModelBase, etc.)
New Contributors
- @panariga made their first contribution in #73
- @Deltachaos made their first contribution in #77
Full Changelog: 0.5.3...0.6.0
TransformersPHP v0.5.3
This release brings new features, critical bug fixes, and improvements to enhance the functionality and performance of the package. Below is a summary of the changes.
What's New
- feat: Add support for PostProcessor Sequence by @CodeWithKyrian in 2cf18cc
- feat: New tensor method
randomby @CodeWithKyrian in 0564dd1 - feat: Correctly parse and use the Precompiled Normalizer by @CodeWithKyrian in 7e880dd
- feat: Update conversion notebook to include task by @CodeWithKyrian in ca6fc3b
Bug Fixes
- fix: Regex bug in Precompiled Normalizer by @CodeWithKyrian in 69089b1
- fix: Improve Unigram Tokenizer handling of multibyte strings by @CodeWithKyrian in e8a8a9a
- fix: Correct WhitespaceSplit Pretokenizer handling of invisible space characters by @CodeWithKyrian in 6ec3e3e
- fix: Correctly handle multibyte strings in Precompiled Normalizer by @CodeWithKyrian in bee47e0
- fix: Fuse function not combining unknown token IDs correctly by @CodeWithKyrian in 3008013
- fix: Tensor topK error when -1 is passed by @CodeWithKyrian in 0564dd1
Improvements
- fix: Precompiled Normalizer improvements by @CodeWithKyrian b012400
I encourage everyone to update to this latest version and explore the new features. As always, feel free to report any issues or contribute to the project.
Full Changelog: 0.5.2...0.5.3
TransformersPHP v0.5.2
What's Changed
- Use a static list for byte-unicode and unicode-byte conversion by @CodeWithKyrian in 75f5d9c
- Fix Vips RGBA -> RGBA conversion error by @CodeWithKyrian in 54bdee0
- Show output progress when downloading the shared libraries by @CodeWithKyrian in d613a0d
- Obviate the need for autoload.php in establishing library base path by @timwhitlock in #65
New Contributors
- @timwhitlock made their first contribution in #65
Full Changelog: 0.5.1...0.5.2
TransformersPHP v0.5.1
What's new
- Tensor Operations:
magnitude,sqrtandcosSimilarityadded. - Vips Binaries: - Vips binaries are now bundled by default, eliminating need to modify anything on the system to use libvips.
Bug Fixes
- Error Handling: - Adjusted error level to a warning for unknown model types, providing clearer feedback without interrupting the workflow.
Reversions
- Dependencies: Reverted
rokka/vipsfrom dev back to normal dependencies. Since vips binaries are bundled by default, use of vips is now encouraged.
Full Changelog: 0.5.0...0.5.1
TransformersPHP v0.5.0
I'm excited to announce the latest version of TransformersPHP, packed with new features, improvements, and bug fixes. This release brings powerful enhancements to your machine-learning-driven PHP applications, enabling more efficient and versatile operations.
New Features
-
New Pipeline: Audio Classification - Easily classify audio clips with a pre-trained model.
$classifier = pipeline('audio-classification', 'Xenova/ast-finetuned-audioset-10-10-0.4593'); $audioUrl = __DIR__ . '/../sounds/cat_meow.wav'; $output = $classifier($audioUrl); // [ // [ // "label" => "Meow" // "score" => 0.6109990477562 // ] // ]
-
New Pipeline: Automatic Speech Recognition (ASR) - Supports models like
wav2vecandwhisperfor transcribing speech to text. If a specific model is not officially supported, please open an issue with a feature request.- Example:
$transcriber = pipeline('asr', 'Xenova/whisper-tiny.en'); $audioUrl = __DIR__ . '/../sounds/preamble.wav'; $output = $transcriber($audioUrl, maxNewTokens: 256); // [ // "text" => "We, the people of the United States, ..." // ]
- Example:
Enhancements
-
Shared Libraries Dependencies: - A revamped workflow for downloading shared libraries dependencies ensures they are versioned correctly, reducing download sizes. These binaries are now thoroughly tested on Apple Silicon, Intel Macs, Linux x86_64, Linux aarch64, and Windows platforms.
-
Transformers::setupSimplified -Transformers::setup()is now optional. Default settings are automatically applied if not called. Theapply()method is no longer necessary, but still available for backward compatibility. -
Immutable Image Utility - The Image utility class is now immutable. Each operation returns a new instance, allowing for method chaining and a more predictable workflow.
$image = Image::read($url); $resizedImage = $image->resize(100, 100); // $image remains unchanged
-
New Tensor Operations - New operations were added:
copyTo,log,exp,pow,sum,reciprocal,stdMean. Additionally, overall performance improvements have been made to Tensor operations. -
TextStreamer Improvements - TextStreamer now prints to stdout by default. You can override this behavior using the
onStream(callable $callback)method. Consequently, theStdoutStreamerclass is now obsolete. -
VIPS PHP Driver Update - The VIPS PHP driver is no longer bundled by default in
composer.json. Detailed documentation is provided for installing the Vips PHP driver and setting up Vips on your machine. -
ONNX Runtime Upgrade - Upgraded to version 1.19.0, bringing more performance and compatibility with newer models.
-
Bug Fixes & Performance Improvements - Various bug fixes have been implemented to enhance stability and performance across the package.
I hope you enjoy these updates and improvements. If you encounter any issues or have any suggestions, please don’t hesitate to reach out through our Issue Tracker
Full Changelog: 0.4.4...0.5.0
v0.4.4
v0.4.3
What's Changed
- Fix typo in docs by @BlackyDrum in #42
- fix: statically calling FFI::new deprecated in PHP 8.3 by @CodeWithKyrian in #48
- fix: improve regex for detecting language codes in NllbTokenizer by @CodeWithKyrian in #49
- fix: digits pre-tokenizer returning empty array for text with no digits by @CodeWithKyrian in #51
- feat: allow passing model filename when downloading a model from CLI
- fix: preTokenizer null error when there's no text pair](901a049)
- feat: implement enforce size divisibility for image feature extractor by @CodeWithKyrian in #53
New Contributors
- @BlackyDrum made their first contribution in #42
Full Changelog: 0.4.2...0.4.3
v0.4.2
What's Changed
- bugfix: Repository url resolution not working properly in Windows by @CodeWithKyrian in #41
Full Changelog: 0.4.1...0.4.2