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

Incorrect documentation or missing implementation (text-to-image) #27

Closed CViniciusSDias closed 5 months ago

CViniciusSDias commented 5 months ago

System Info

Linux (WSL2) codewithkyrian/transformers: ^0.3.1

PHP Version

8.3.4

Environment/Platform

Description

The multimodal part of the documentation states that the text-to-image task is supported, but when trying to run it, I receieve the following error:

Fatal error: Uncaught Codewithkyrian\Transformers\Exceptions\UnsupportedTaskException: The task text-to-image is not supported. Please check for typos or refer to the documentation for the list of supported tasks. in /app/vendor/codewithkyrian/transformers/src/Exceptions/UnsupportedTaskException.php:12 Stack trace:

0 /app/vendor/codewithkyrian/transformers/src/Pipelines/Pipeline.php(75): Codewithkyrian\Transformers\Exceptions\UnsupportedTaskException::make('text-to-image')

1 /app/transformers.php(23): Codewithkyrian\Transformers\Pipelines\pipeline(NULL)

2 {main}

thrown in /app/vendor/codewithkyrian/transformers/src/Exceptions/UnsupportedTaskException.php on line 12

Reproduction

Run the following code and see the error:

<?php

use function Codewithkyrian\Transformers\Pipelines\pipeline;

require 'vendor/autoload.php';

$vision = pipeline('text-to-image');
var_dump($vision("cat"));
CodeWithKyrian commented 5 months ago

Oh. My bad. It's definitely incorrect documentation. The currently supported task is image-to-text not text-to-image. So sorry for the confusion. Will update the docs.

CViniciusSDias commented 5 months ago

No need to apologize. And thanks for the work on this project. <3