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

Attempted to load class "PretrainedModel" in Symfony 5 #3

Closed tuanla-kiai closed 6 months ago

tuanla-kiai commented 6 months ago

System Info

Symfony 5

PHP Version

8.1.27

Environment/Platform

Description

Hi, I get an error, please help me. image

Reproduction

        $fillMask = pipeline('fill-mask');

        $result = $fillMask('The quick brown <mask> jumps over the lazy dog.');
CodeWithKyrian commented 6 months ago

Thanks for bringing this to my attention. I just noticed the slight discrepancy between the naming (uppercase T in some places, and lowercase in others) - PreTrainedModel and PretrainedModel. For MacOSX, which I'm using for development, vim File and vim file are the same, so it will work with no problem. I guess that's why it slipped through my fingers. I'll fix it right away

CodeWithKyrian commented 6 months ago

Fixed in https://github.com/CodeWithKyrian/transformers-php/pull/4. Update to v0.2.0 to access the changes

tuanla-kiai commented 6 months ago

@CodeWithKyrian Same error with WordpieceTokenizer in Tokenizer file (line 64), please update it 🚀

CodeWithKyrian commented 6 months ago

Thanks for that. Update to v0.2.1 to access the fixes