Skip to content

Remove uv.lock from gitignore - #57

Open
andy778 wants to merge 2 commits into
AI-Riksarkivet:mainfrom
andy778:uv-lock-upstream
Open

andy778 wants to merge 2 commits into
AI-Riksarkivet:mainfrom
andy778:uv-lock-upstream

Conversation

@andy778

@andy778 andy778 commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

There was no committed lockfile so depdendabot and running a baseline from the past would not work as it was latest

  • Remove uv.lock from .gitignore and commit it.
  • Dependabot's Python ecosystem to uv
  • Drop the huggingface-hub[cli] extra — it no longer exists upstream

Checklist

  • I have performed a self-review of my code locally
  • I have run ruff format to format my code.
  • My code passes ruff check.
  • If it is a core feature, I have added thorough tests.
  • Documentation has been updated or the changes are too minor to be documented

andy778 and others added 2 commits July 28, 2026 19:16
There is no committed lockfile, so every install resolves to whatever
is currently latest on PyPI. That means no reproducible builds, and it
lets upstream dependency changes land silently: the current transformers
5.x already breaks WordLevelTrOCR word segmentation on a fresh install
(sdpa attention silently drops the cross_attentions the heatmap-based
segmentation depends on), with nothing pinning a known-good set.

It also means the Dockerfiles under docker/ can't build from a clean
clone at all - they COPY uv.lock and run uv sync --frozen, but the file
isn't in git.

- Remove uv.lock from .gitignore and commit it.
- Add .github/dependabot.yml covering uv (pyproject.toml + uv.lock),
  github-actions and docker, weekly. No target-branch, so it follows
  whatever the repo's default branch is.
- Drop the huggingface-hub[cli] extra: it no longer exists upstream
  (the hf CLI ships in the base package now, huggingface-cli is
  deprecated), and uv lock warns about it on every run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mers

These two bugs are already live on main today: transformers has no
upper version bound in pyproject.toml, and there's no committed
uv.lock, so a fresh install already pulls in a transformers/tokenizers
version that trips both of them.

- TrOCRProcessor.feature_extractor was removed in favor of
  .image_processor.
- The default `sdpa` attention implementation silently drops
  cross_attentions, which WordLevelTrOCR's heatmap-based word
  segmentation depends on; force attn_implementation="eager" for it.
- Per-token decoding relied on batch_decode(1-D tensor) iterating one
  token per element; newer tokenizers backends treat that as a single
  sequence instead, collapsing all tokens into one string and breaking
  word-boundary detection. Decode each token id as its own
  single-token sequence instead.
- Fix an ALTO template bug where `| default('')` bound only to the
  ternary's else-branch (Jinja operator precedence), so a line with no
  word-level sub-regions raised UndefinedError instead of falling back
  to an empty hyphenation string.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@andy778

andy778 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Had to add this also to fix so all checks pass
"Fix WordLevelTrOCR and ALTO export breakage exposed by newer transformers"

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant