mlcommons / mlcommons/modelbench

Replace Locale object with just strings

Open
#764 2 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.