transformers-php  by CodeWithKyrian

PHP toolkit for machine learning projects

Created 1 year ago
699 stars

Top 48.8% on SourcePulse

GitHubView on GitHub
Project Summary

TransformersPHP provides PHP developers with a toolkit to integrate state-of-the-art machine learning models into their applications. It offers a familiar API, mirroring Python's Hugging Face Transformers library, enabling tasks like text generation, summarization, and translation.

How It Works

This library leverages ONNX Runtime for high-performance model execution, allowing PHP applications to utilize models converted from PyTorch or TensorFlow via 🤗 Optimum. It features a high-level pipeline API that abstracts away preprocessing and postprocessing steps, simplifying model integration.

Quick Start & Requirements

  • Install via Composer: composer require codewithkyrian/transformers
  • Requires PHP FFI extension (enabled by default in PHP 7.4+). Ensure extension=ffi and ffi.enable=true are set in php.ini.
  • ONNX Runtime is platform-specific; install within your target environment (e.g., Docker container).
  • Documentation: https://codewithkyrian.github.io/transformers-php

Highlighted Details

  • Functionally equivalent API to Python's Hugging Face Transformers.
  • Supports a wide range of NLP tasks and several vision tasks.
  • Models are automatically downloaded from Hugging Face or can be pre-downloaded via CLI.
  • Configurable cache directory, remote host, authentication tokens, and image drivers.

Maintenance & Community

  • Project appears to be actively developed by CodeWithKyrian.
  • No explicit community links (Discord/Slack) or roadmap are provided in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is undetermined.

Limitations & Caveats

  • The library is marked as a "Work In Progress" (WIP), with several tasks listed as unsupported (e.g., Table QA, Depth Estimation, most Audio tasks).
  • Model conversion to ONNX is a prerequisite for custom models.
  • No license information is provided, which may impact commercial adoption.
Health Check
Last Commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
5
Issues (30d)
3
Star History
7 stars in the last 30 days

Explore Similar Projects

Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), and
42 more.

spaCy by explosion

0.1%
32k
NLP library for production applications
Created 11 years ago
Updated 3 months ago
Feedback? Help us improve.