You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FFI::addr() cannot create a reference to a temporary pointer #28
Basically, I'm doing a test, but using Laravel Framework in the most current version (11.0). Previously I did a test using a hugface text-to-text model, however, I changed it to the "Hello world" that the transformersphp documentation suggests:
So the code looked like this:
<?phpuseIlluminate\Support\Facades\Route;
usefunctionCodewithkyrian\Transformers\Pipelines\pipeline;
Route::get('/', function () {
// return phpinfo();$pipe = pipeline('sentiment-analysis');
return$pipe('I love transformers!');
});
As you may have noticed, I used phpinfo() to check if the suggested extensions were installed:
When I was debugging the code I came across this PHP alert
PHP Warning: PHP Startup: Unable to load dynamic library 'ffi' (tried: /usr/local/lib/php/pecl/20230831/ffi (dlopen(/usr/local/lib/php/pecl/20230831/ffi, 0x0009): tried: '/usr/local/lib/php/pecl/20230831/ffi' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/php/pecl/20230831/ffi' (no such file), '/usr/local/lib/php/pecl/20230831/ffi' (no such file)), /usr/local/lib/php/pecl/20230831/ffi.so (dlopen(/usr/local/lib/php/pecl/20230831/ffi.so, 0x0009): tried: '/usr/local/lib/php/pecl/20230831/ffi.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/php/pecl/20230831/ffi.so' (no such file), '/usr/local/lib/php/pecl/20230831/ffi.so' (no such file))) in Unknown on line 0
I imagined it was something with the FFI library, so I decided to install it using perl, however, the message appears to me:
Hello @victorratts13. Does the problem still persist? It appears to be a problem with your FFI setup. If I may ask, how did you php? Herd, Brew or apt-get?
Activity
CodeWithKyrian commentedon Apr 30, 2024
Can you provide more information about the model, and some code on how you set things up so I can try to reproduce the error?
victorratts13 commentedon Apr 30, 2024
Basically, I'm doing a test, but using Laravel Framework in the most current version (11.0). Previously I did a test using a hugface text-to-text model, however, I changed it to the "Hello world" that the transformersphp documentation suggests:
So the code looked like this:
As you may have noticed, I used phpinfo() to check if the suggested extensions were installed:
victorratts13 commentedon Apr 30, 2024
UPDATE:
When I was debugging the code I came across this PHP alert
I imagined it was something with the FFI library, so I decided to install it using perl, however, the message appears to me:
CodeWithKyrian commentedon May 3, 2024
Hello @victorratts13. Does the problem still persist? It appears to be a problem with your FFI setup. If I may ask, how did you php? Herd, Brew or apt-get?
victorratts13 commentedon May 3, 2024
I just found the problem.
1 - I installed an ubuntu-server VM to test outside my work environment.
2 - I installed all the development packages that transformersphp uses
sudo apt update && sudo apt install -y libffi-dev libz-dev libpng-dev git libzip-dev3 - I ran the code again and it worked
Conclusion
It remained to install the dependencies that make FFI work within the command line
CodeWithKyrian commentedon May 6, 2024
Oh, that's great. I was going to suggest installing php-ffi using apt-get actually. I'm glad it's all resolved