Skip to content
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

Feature improve plugginability #7

Merged
merged 7 commits into from
Sep 20, 2023
Merged

Conversation

Crivella
Copy link
Owner

Plugins can now be used to also add models to the database via the following entrypoints:

  • ocr_translate.box_data
  • ocr_translate.ocr_data
  • ocr_translate.tsl_data

The entrypoint should point to a dict with the info to create the model.
See init of plugins for example (care that box/ocr/tsl may need to define different keys).

Information about model-specific language codes is now encoded into an iso1_map field of the model.

  • Before new models with custom codes in a plugin would require to also edit the main repo and adding a new column to languages in the database.
  • Now the plugin can set the lang_code to whatever is closest to the model codes, and overwrite what does not match using iso1_map, by mapping iso-639-1 codes to the model-specific ones.

Tag only without release as the changes still requires plugins to be baked in with the installer (they cannot be dynamically added without an hack-ish solution).

@Crivella Crivella merged commit 2d19366 into master Sep 20, 2023
@Crivella Crivella deleted the feature-improve_plugginability branch September 20, 2023 17:26
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