If the config.json file for a model does not yet exist, I encounter the following error:
Codewithkyrian\Transformers\Utils\AutoConfig::__construct(): Argument #1 ($config) must be of type array, null given, called in C:\Users\Gani\Desktop\transformers\vendor\codewithkyrian\transformers\src\Utils\AutoConfig.php on line 53
However, if the config.json file for a model does exist, I get this error:
Error 0 occurred while trying to load file from https://huggingface.co\Xenova/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/onnx\model_quantized.onnx
The issue seems to stem from this line in the code for me:
This fixed both errors for me. However, this issue with the backslash being escaped might be specific to my configuration (although I don't know how), and I'm not certain if it occurs for others aswell.
System Info
Windows 10, PHP built-in Webserver, Laravel 11
PHP Version
8.3.1
Environment/Platform
Description
If the
config.json
file for a model does not yet exist, I encounter the following error:However, if the
config.json
file for a model does exist, I get this error:The issue seems to stem from this line in the code for me:
When I dump the value of
$url
, it appears correct:However, when I dump the URL using
curl_getinfo($curlHandle)
, the URL value is:It seems the backslash character is being escaped for me. The line
$error = curl_error($curlHandle);
also indicates a hostname error:For me it worked when I changed this:
to this:
This fixed both errors for me. However, this issue with the backslash being escaped might be specific to my configuration (although I don't know how), and I'm not certain if it occurs for others aswell.
Reproduction