mlcommons / mlcommons/modelbench
Replace Locale object with just strings
@rogthefrog is already working on this.
Since Dec 19, 2024.
- Dominant language
- Python
- Stars
- 134
- Forks
- 36
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 17
Description
The code is playing fast and loose with types for locales, and sometimes it's sending Locale objects and sometimes just strings, even when the type hint requests one type.
The Locale enum doesn't add much functionality, and it causes issues when the wrong type is passed (e.g. if the code expects a Locale but receives a string, or vice versa, an exception is thrown unless you handle it).
A string + maybe one validation function like is_locale(locale): return locale.lower() in ("en_us", "fr_fr") would simplify things.
@bkorycki @rogthefrog discussed this in Discord.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.