Skip to content

Releases: CodeWithKyrian/transformers-php

TransformersPHP v0.5.2

29 Aug 13:11
d4c5959
Compare
Choose a tag to compare
Pre-release

What's Changed

New Contributors

Full Changelog: 0.5.1...0.5.2

TransformersPHP v0.5.1

24 Aug 05:39
Compare
Choose a tag to compare
Pre-release

What's new

  • Tensor Operations: magnitude, sqrt and cosSimilarity added.
  • 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/vips from 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

21 Aug 03:00
Compare
Choose a tag to compare
Pre-release

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 wav2vec and whisper for 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, ..."
      // ]

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::setup Simplified - Transformers::setup() is now optional. Default settings are automatically applied if not called. The apply() 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, the StdoutStreamer class 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

14 Aug 16:10
49fbf23
Compare
Choose a tag to compare
v0.4.4 Pre-release
Pre-release

What's Changed

  • feat: add optional host argument for model download by @k99k5 in #56

New Contributors

  • @k99k5 made their first contribution in #56

Full Changelog: 0.4.3...0.4.4

v0.4.3

31 Jul 15:02
d812db1
Compare
Choose a tag to compare
v0.4.3 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: 0.4.2...0.4.3

v0.4.2

05 Jun 07:43
67a6715
Compare
Choose a tag to compare
v0.4.2 Pre-release
Pre-release

What's Changed

  • bugfix: Repository url resolution not working properly in Windows by @CodeWithKyrian in #41

Full Changelog: 0.4.1...0.4.2

v0.4.1

24 May 03:52
ebfb298
Compare
Choose a tag to compare
v0.4.1 Pre-release
Pre-release

What's Changed

  • configuration.md: fix indentation of Transformers::setup() by @k00ni in #35
  • PretrainedTokenizer::truncateHelper: prevent array_slice() error for flawed text input (summarization) by @k00ni in #36
  • Fix bug with Download CLI - use named parameters for model construct by @CodeWithKyrian in #39

New Contributors

  • @k00ni made their first contribution in #35

Full Changelog: 0.4.0...0.4.1

v0.4.0

15 May 11:24
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

This release marks a significant milestone in enhancing the performance and functionality of the Tensor class while introducing convenient tools to streamline the installation of essential dependencies. These improvements not only optimize existing operations but also pave the way for future enhancements and expanded capabilities within the project.

What's Changed

  • New Inference Session: The InferenceSession has been overhauled to now receive Tensor inputs directly, facilitating easier conversion of Tensor objects to ONNX Tensors by simplifying memory copying.
  • Overhaul Tensor Buffer Implementation: The Tensor class has been revamped to utilize OpenBlas and Rindow Matlib C shared libraries, introducing a massive performance improvements in Tensor operations.
  • PHP Buffer Fallback: When the C Based Buffer fails for some reason, there's still a working PHP buffer implemented as a fallback, which is obviously slower, but will prevent errors.
  • OpenMP Integration: The Tensor operations can be further optimized further by utilizing the parallel operation ability of OpenMP with an optional fallback to the the non OpenMP alternatives when OpenMP isn't installed.
  • New Tensor Methods: Several new methods, including topk, divide, and slice, have been added to the Tensor class, along with corresponding changes to existing implementations to leverage these methods.
  • Refactor Stack Method: The stack method in the Tensor class has been refactored for enhanced performance.
  • Move Thumbnail Method: The thumbnail method has been relocated from the feature extractor to the Image class for improved organization.
  • Code Cleanup and Style Review: The codebase has undergone cleanup and style review to ensure consistency and readability.
  • Optimize Image <-> Tensor Conversion: Efforts have been made to optimize the speed of conversion between Image and Tensor objects, and vice versa enhancing overall performance for image related tasks.
  • Image Driver Configuration: While Image driver setting can still be set in the Transformers class, it can be set directly on the Image class, allowing it to be used independently.
  • Introduce Libraries Loader: A new library loader package has been introduced to automate the downloading of required shared libraries, such as onnxruntime, openblas, and rindow-matlib, during the Composer install process.
  • TinyLlama Support: Add support for the TinyLlama model by @CodeWithKyrian
  • Install Command Returned: Returned the install command back to serve as an alternative way of getting the shared libraries if it fails for any reason during composer install.

New Contributors

Full Changelog: 0.3.1...0.4.0

v0.3.1

22 Apr 22:02
85361c0
Compare
Choose a tag to compare
v0.3.1 Pre-release
Pre-release

What's Changed

Full Changelog: 0.3.0...0.3.1

v0.3.0

13 Apr 23:58
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

What's Changed

Breaking Changes

  • The install command no longer exists, as the required libraries are downloaded automatically on composer install.
  • New Image driver configuration settings added that required either GD, Imagick or Vips

New Contributors

Full Changelog: 0.2.2...0.3.0