AI-Riksarkivet / htrflow

HTRflow is the underlying engine for our HTR-pipeline
https://ai-riksarkivet.github.io/htrflow
European Union Public License 1.2
16 stars 3 forks source link

Example pipeline.yaml throws error #24

Closed Abbe98 closed 1 month ago

Abbe98 commented 1 month ago

What happened?

Using the example pipeline.yaml from the quickstart guide with the PyPi package results in the following error:

│ /home/container-57/.local/lib/python3.12/site-packages/htrflow/pipeline/steps.py:293 in init_step                                                                                                              │
│                                                                                                                                                                                                        │
│   290 │   │   step_settings: A dictionary containing parameters for the step's                                                                                                                         │
│   291 │   │   │   __init__() method.                                                                                                                                                                   │
│   292 │   """                                                                                                                                                                                          │
│ ❱ 293 │   return STEPS[step_name.lower()].from_config(step_settings)                                                                                                                                   │
│   294                                                                                                                                                                                                  │
│                                                                                                                                                                                                        │
│ ╭────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮                                                                                        │
│ │     step_name = 'Segmentation'                                                                              │                                                                                        │
│ │ step_settings = {'model': 'yolo', 'model_settings': {'model': 'Riksarkivet/yolov9-lines-within-regions-1'}} │                                                                                        │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                                        │
│                                                                                                                                                                                                        │
│ /home/container-57/.local/lib/python3.12/site-packages/htrflow/pipeline/steps.py:62 in from_config                                                                                                             │
│                                                                                                                                                                                                        │
│    59 │   │   │   model_names = [model.__name__ for model in all_models()]                                                                                                                             │
│    60 │   │   │   msg = f"Model {name} is not supported. The available models are: {', '.join(                                                                                                         │
│    61 │   │   │   logger.error(msg)                                                                                                                                                                    │
│ ❱  62 │   │   │   raise NotImplementedError(msg)                                                                                                                                                       │
│    63 │   │   init_kwargs = config.get("model_settings", {})                                                                                                                                           │
│    64 │   │   model = MODELS[name]                                                                                                                                                                     │
│    65 │   │   generation_kwargs = config.get("generation_settings", {})                                                                                                                                │
│                                                                                                                                                                                                        │
│ ╭───────────────────────────────────────────────── locals ──────────────────────────────────────────────────╮                                                                                          │
│ │      config = {'model': 'yolo', 'model_settings': {'model': 'Riksarkivet/yolov9-lines-within-regions-1'}} │                                                                                          │
│ │ model_names = ['DiT', 'LLavaNext', 'TrOCR', 'WordLevelTrOCR']                                             │                                                                                          │
│ │         msg = 'Model yolo is not supported. The available models are: DiT, LLavaNext, TrOCR, Wo'+13       │                                                                                          │
│ │        name = 'yolo'                                                                                      │                                                                                          │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NotImplementedError: Model yolo is not supported. The available models are: DiT, LLavaNext, TrOCR, WordLevelTrOCR.

Steps To Reproduce

No response

Relevant log output

No response

viklofg commented 1 month ago

Hi!

This issue is probably related to #23. The YOLO model was not included in the base installation of htrflow in version 0.1.1., but has been added in version 0.1.2. Let me know if this issue persists after upgrading to 0.1.2!

Abbe98 commented 1 month ago

The issue is still present after updating.

Abbe98 commented 1 month ago

Okay, I think I figured it out; 1.1.1 was the last version on PyPi which listed support for Python 12/13 so everyone installing it on Python 12/13 will get the old version as the latest. Causing both this and #23.

viklofg commented 1 month ago

Great find, thank you! For now, HTRflow is only officially supported in Python 3.10. I'll update the package on PyPi to reflect that.

Abbe98 commented 1 month ago

It might stab a few given that not even Debian(and co) supports Python 10: https://wiki.debian.org/Python#Supported_Python_Versions