mittagessen / kraken

OCR engine for all the languages
http://kraken.re
Apache License 2.0
673 stars 125 forks source link

Cut a new release due to zenodo changes #573

Closed IohannesArnold closed 3 months ago

IohannesArnold commented 4 months ago

This is just to report that when I used the most recent published version of kraken, while I could run kraken list just fine, I would run into the error below with kraken get. I then saw issue #561 which made me try the master branch, and that worked fine. So you might want to cut a release soon; a point release at least even if bigger goals are not yet complete.

kraken get 10.5281/zenodo.2577813
Processing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% 0/0 bytes 0:00:00 0:00:00
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ RETACTED/.venv/bin/kraken:8 in <module>                       │
│                                                                                                  │
│   5 from kraken.kraken import cli                                                                │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(cli())                                                                          │
│   9                                                                                              │
│                                                                                                  │
<CUT>
│                                                                                                  │
│ REDACTED/.venv/lib/python3.10/site-packages/kraken/kraken.py:                                    │
│ 704 in get                                                                                       │
│                                                                                                  │
│   701 │                                                                                          │
│   702 │   with KrakenDownloadProgressBar() as progress:                                          │
│   703 │   │   download_task = progress.add_task('Processing', total=0, visible=True if not ctx   │
│ ❱ 704 │   │   filename = repo.get_model(model_id, click.get_app_dir(APP_NAME),                   │
│   705 │   │   │   │   │   │   │   │     lambda total, advance: progress.update(download_task,    │
│   706 │   message(f'Model name: {filename}')                                                     │
│   707 │   ctx.exit(0)                                                                            │
│                                                                                                  │
│ REDACTED/.venv/lib/python3.10/site-packages/kraken/repo.py:135 in get_model                      |
│                                                                                                  │
│   132 │   │   raise KrakenRepoException(f'Found {resp["hits"]["total"]} models when querying f   │
│   133 │                                                                                          │
│   134 │   metadata = resp['hits']['hits'][0]                                                     │
│ ❱ 135 │   model_url = [x['links']['self'] for x in metadata['files'] if x['type'] == 'mlmodel'   │
│   136 │   # callable model identifier                                                            │
│   137 │   nat_id = os.path.basename(urllib.parse.urlparse(model_url).path)                       │
│   138 │   spath = os.path.join(path, nat_id)                                                     │
│                                                                                                  │
│ REDACTED/.venv/lib/python3.10/site-packages/kraken/repo.py:135 in <listcomp>                     |
│                                                                                                  │
│   132 │   │   raise KrakenRepoException(f'Found {resp["hits"]["total"]} models when querying f   │
│   133 │                                                                                          │
│   134 │   metadata = resp['hits']['hits'][0]                                                     │
│ ❱ 135 │   model_url = [x['links']['self'] for x in metadata['files'] if x['type'] == 'mlmodel'   │
│   136 │   # callable model identifier                                                            │
│   137 │   nat_id = os.path.basename(urllib.parse.urlparse(model_url).path)                       │
│   138 │   spath = os.path.join(path, nat_id)                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'type'
johnlockejrr commented 4 months ago

Same here, just wanted to open an issue

johnlockejrr commented 4 months ago

Latest (main) version of kraken from github works:

(kraken_2) incognito@Nobody-Lap:~/kraken-dev$ kraken get 10.5281/zenodo.5468286
Processing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 16.1/16.1 MB 0:00:00 0:00:07
Model name: BiblIA_01.mlmodel
mittagessen commented 4 months ago

I'm waiting to merge https://github.com/mittagessen/kraken/pull/555 and then I'll tag a new release. Which shouldn't take longer than a week or two.

mittagessen commented 3 months ago

Kraken 5 has been released which makes the repository accessible from the CLI again.