adithya-s-k / adithya-s-k/marker-api

KeyError: 'sdpa'

Aperta
#21 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
983
Fork
116
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi! When I try to run the simple server I get this error:

> config.json: 100%|████████████████████████████████████████████████████████████████████| 811/811 [00:00 model.safetensors: 100%|████████████████████████████████████████████████████| 154M/154M [00:07<00:00, 20.4MB/s]
> Loaded detection model vikp/surya_det3 on device cpu with dtype torch.float32
> preprocessor_config.json: 100%|███████████████████████████████████████████████████████| 675/675 [00:00 config.json: 100%|████████████████████████████████████████████████████████████████| 1.32k/1.32k [00:00 model.safetensors: 100%|████████████████████████████████████████████████████| 154M/154M [00:07<00:00, 21.1MB/s]
> Loaded detection model vikp/surya_layout3 on device cpu with dtype torch.float32
> preprocessor_config.json: 100%|███████████████████████████████████████████████████████| 373/373 [00:00 config.json: 100%|████████████████████████████████████████████████████████████████| 5.04k/5.04k [00:00 model.safetensors: 100%|████████████████████████████████████████████████████| 550M/550M [00:29<00:00, 18.8MB/s]
> ERROR: Traceback (most recent call last):
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\routing.py", line 693, in lifespan
> async with self.lifespan_context(app) as maybe_state:
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 210, in __aenter__
> return await anext(self.gen)
> ^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\gradio\routes.py", line 1650, in new_lifespan
> async with old_lifespan(
> ^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 210, in __aenter__
> return await anext(self.gen)
> ^^^^^^^^^^^^^^^^^^^^^
> File "D:\ppgbe\Documents\GitHub\marker-api\server.py", line 39, in lifespan
> model_list = load_all_models()
> ^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker\models.py", line 74, in load_all_models
> order = setup_order_model(device, dtype)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker\models.py", line 61, in setup_order_model
> model = load_order_model()
> ^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\surya\model\ordering\model.py", line 27, in load_model
> model = OrderVisionEncoderDecoderModel.from_pretrained(checkpoint, config=config, torch_dtype=dtype)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\models\vision_encoder_decoder\modeling_vision_encoder_decoder.py", line 376, in from_pretrained
> return super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\modeling_utils.py", line 4097, in from_pretrained
> model = cls(config, *model_args, **model_kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\models\vision_encoder_decoder\modeling_vision_encoder_decoder.py", line 199, in __init__
> decoder = AutoModelForCausalLM.from_config(config.decoder)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\models\auto\auto_factory.py", line 440, in from_config
> return model_class._from_config(config, **kwargs)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\modeling_utils.py", line 1544, in _from_config
> model = cls(config, **kwargs)
> ^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\surya\model\ordering\decoder.py", line 495, in __init__
> self.model = MBartOrderDecoderWrapper(config)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\surya\model\ordering\decoder.py", line 480, in __init__
> self.decoder = MBartOrderDecoder(config)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\surya\model\ordering\decoder.py", line 294, in __init__
> self.layers = nn.ModuleList([MBartOrderDecoderLayer(config) for _ in range(config.decoder_layers)])
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "C:\Users\ppgbe\AppData\Local\Programs\Python\Python312\Lib\site-packages\surya\model\ordering\decoder.py", line 209, in __init__
> self.self_attn = MBART_ATTENTION_CLASSES[config._attn_implementation](
> ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> KeyError: 'sdpa'
>
> ERROR: Application startup failed. Exiting.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.