8000 Ensure compatibility with MLLM models trained using Annif 1.2 or older by osma · Pull Request #834 · NatLibFi/Annif · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ensure compatibility with MLLM models trained using Annif 1.2 or older #834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

osma
Copy link
Member
@osma osma commented Feb 7, 2025

This adds a check to ensure that MLLM TokenSet objects use frozenset to store tokens. In models prior to Annif 1.3, the tokens were stored in a mutable set. The __setstate__ method is called during unpickling and handles the conversion so that older models will still work.

We could drop this later on if compatibility with older models is no longer relevant, for example if there is another reason that they will stop working anyway.

@osma osma added the bug label Feb 7, 2025
@osma osma added this to the 1.3 milestone Feb 7, 2025
@osma osma self-assigned this Feb 7, 2025
@osma osma requested a review from juhoinkinen February 7, 2025 12:23
Copy link
codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.63%. Comparing base (3752c26) to head (3657c6a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #834   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files          96       96           
  Lines        7217     7220    +3     
=======================================
+ Hits         7191     7194    +3     
  Misses         26       26           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member
@juhoinkinen juhoinkinen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this quickly, works.

Copy link
sonarqubecloud bot commented Feb 7, 2025

@osma osma merged commit f23484c into main Feb 7, 2025
16 of 17 checks passed
@osma osma deleted the issue822-mllm-ambiguity-old-model-frozenset branch February 7, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0