CodeWithKyrian / transformers-php

Transformers PHP is a toolkit for PHP developers to add machine learning magic to their projects easily.
https://codewithkyrian.github.io/transformers-php/
Apache License 2.0
530 stars 28 forks source link

Add support for PHI3 model #29

Open victorratts13 opened 5 months ago

victorratts13 commented 5 months ago

Type of feature request

🌟New Model

Feature description

The phi3 model is important for certain application scenarios, and its addition would significantly increase the flexibility and usefulness of the library for users. We appreciate your consideration of this request and are available to provide any additional information if needed.

Motivation

Currently, when attempting to use the phi3 model for a task, the following runtime error occurs:

The model type `phi3` is not supported for this task. Please check for typos or refer to the documentation for the list of supported model types.

This indicates that the phi3 model is not supported by the library for the given task. However, in response to user requests and the need to utilize the phi3 model, we would like to request the addition of support for this model in the library.

Your contribution

Proposal:

CodeWithKyrian commented 5 months ago

Thanks for your continued interest @victorratts13 . As I mentioned in https://github.com/CodeWithKyrian/transformers-php/issues/26, TransformersPHP doesn't support models larger than 2GB for now. OnnxRuntime uses Protobuf buffers to store the models, and they have a 2GB file limit. To make it work, models above that limit have to be split into multiple files, and the current state of the library does not account for downloading and loading multiple files

Rest assured, I have this feature request on top of my mind. Phi 3 is a very fantastic model and gives very impressive results. I'll bump it to the top of the list and work on it as soon as the next release is published (which should be very soon).

victorratts13 commented 5 months ago

Thanks for answering. I'm working on a project responsible for using huggingface AI models with PHP/Laravel. Your library is the most promising I found. If you allow me, I would like to contribute.

CodeWithKyrian commented 5 months ago

Yeah sure. I'm very much open to contribution.