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

KeyError: 'sdpa'

Offen
#21 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
983
Forks
116
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.