Created
April 13, 2024 19:52
-
-
Save CViniciusSDias/889343bfdf98a8eec9f2018b56e948c9 to your computer and use it in GitHub Desktop.
TransformersPHP error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:8.3-cli | |
RUN apt update && apt install -y libffi-dev libz-dev libpng-dev git libzip-dev | |
RUN docker-php-ext-install ffi sockets gd pcntl zip | |
COPY --from=composer:2.5.8 /usr/bin/composer /usr/bin/composer | |
RUN composer require codewithkyrian/transformers | |
RUN ./vendor/bin/transformers install | |
COPY transformers.php . | |
CMD ["php", "transformers.php"] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use function Codewithkyrian\Transformers\Pipelines\pipeline; | |
require 'vendor/autoload.php'; | |
$classifier = pipeline('sentiment-analysis'); | |
var_dump($classifier('I love TransformersPHP!')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment