Skip to content

M2M100 - English to ChineseMandarin ONNX Model #463

Open
@chriskyndrid

Description

I'm attempting to translate from English to ChineseMandarin. The target languages in the rust_bert crate indicate ChineseMandarin is a supported language. Additionally the documentation on hugging fast also indicates it's a supported language and even provides an example of the translation. However, the get_iso_639_1_code routine explcitly returns Language::ChineseMandarin => return None, for callers. Swapping to Language::Chinese which maps to 'zh', which I believe is the accurate code, returns an error that the language isn't valid. Thus, the ChineseMandarin language passes the validity check, but doesn't end up with an ISO code, so translation fails at:

         let language_code = target_language.get_iso_639_1_code().ok_or_else(|| {
                            RustBertError::ValueError(format!(
                                "This language has no ISO639-I language code representation. \
                            languages supported by the model: {supported_target_languages:?}"
                            ))
                        })?;
                        

I believe the ISO check here should support ChineseMandarin and map to "zh" in the call to fetch the ISO code.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions