Error When Pulling Model Using Label Studio ML Backend
Attempting to use this model with the Label Studio backend, as per these instructions (via docker compose approach):
https://github.com/HumanSignal/label-studio-ml-backend/tree/master/label_studio_ml/examples/gliner
Results in this error:
gliner | [2024-12-10 16:57:54,294] [INFO] [model::::18] Loading GLINER model gliner-community/gliner_large-v2.5
gliner | [2024-12-10 16:57:54,299] [DEBUG] [urllib3.connectionpool::_new_conn::1022] Starting new HTTPS connection (1): huggingface.co:443
gliner | [2024-12-10 16:57:54,371] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /gliner-community/gliner_large-v2.5/resolve/main/config.json HTTP/1.1" 404 0
gliner | [2024-12-10 16:57:54,406] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /gliner-community/gliner_large-v2.5/resolve/main/gliner_base.pt HTTP/1.1" 40 4 0
gliner | [2024-12-10 16:57:54,440] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /gliner-community/gliner_large-v2.5/resolve/main/gliner_multi.pt HTTP/1.1" 4 04 0
gliner | [2024-12-10 16:57:54,483] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /gliner-community/gliner_large-v2.5/resolve/main/pytorch_model.bin HTTP/1.1" 302 0
gliner | [2024-12-10 16:57:54,510] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /gliner-community/gliner_large-v2.5/resolve/main/gliner_config.json HTTP/1.1 " 200 0
gliner | [2024-12-10 16:57:54,539] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /microsoft/deberta-v3-large/resolve/main/tokenizer_config.json HTTP/1.1" 200 0
gliner | /usr/local/lib/python3.11/site-packages/transformers/convert_slow_tokenizer.py:561: UserWarning: The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallb ack option which is not implemented in the fast tokenizers. In practice this means that the fast version of the tokenizer can produce unknown tokens whereas the sentencepiece version would have conv erted these unknown tokens into a sequence of byte tokens matching the original piece of text.
gliner | warnings.warn(
gliner | [2024-12-10 16:57:55,987] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /microsoft/deberta-v3-large/resolve/main/preprocessor_config.json HTTP/1.1" 404 0
gliner | [2024-12-10 16:57:56,016] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /microsoft/deberta-v3-large/resolve/main/config.json HTTP/1.1" 200 0
gliner | [2024-12-10 16:57:56,436] [DEBUG] [urllib3.connectionpool::_make_request::475] https://huggingface.co:443 "HEAD /microsoft/deberta-v3-large/resolve/main/model.safetensors HTTP/1.1" 404 0
gliner |
gliner | Error: Error(s) in loading state_dict for GLiNER:
gliner | size mismatch for token_rep_layer.bert_layer.model.embeddings.word_embeddings.weight: copying a param with shape torch.Size([128003, 1024]) from checkpoint, the shape in current mode l is torch.Size([128004, 1024]).
gliner |
gliner exited with code 1
I believe this is a result of the vocab_size param set within: https://huggingface.co/gliner-community/gliner_large-v2.5/blob/main/gliner_config.json
Note that attempts to instead utilize https://huggingface.co/urchade/gliner_large-v2.1 work without issue (the gliner_config.json does not specify vocab_size in that repo).
To reproduce, follow the instructions on the label studio repo linked above and modify model.py to reference "gliner-community/gliner_large-v2.5" instead of "urchade/gliner_medium-v2.1" on line 17.