Skip to content

Conversation

@AkshitGulyan
Copy link
Contributor

A Hindi Translation for README

What does this PR do?

It adds the Hindi Translation for the README File !

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

A Hindi Translation for README
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Can you also add the proper info in this dictionary so this translation is kept up to date when we add new models?

@AkshitGulyan
Copy link
Contributor Author

added the proper info in this dictionary

By a new pull request
Update check_copies.py #19905

@sgugger
Copy link
Collaborator

sgugger commented Oct 26, 2022

No this should all be in the same pull request please.

Added the Proper info for Hindi Translation of README File !
@AkshitGulyan
Copy link
Contributor Author

No this should all be in the same pull request please.

Updated the check_copies.py in this current Pull Request and closed the previous Pull Request !

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Hello @AkshitGulyan, great work 🤗. Thanks for putting in a lot of effort for making transformers accessible to an even larger number of people who are comfortable in Hindi language ✨. Looking good, left comments for improving readability.

Fixed some translation issues !
@AkshitGulyan
Copy link
Contributor Author

Any Update ?

@sgugger
Copy link
Collaborator

sgugger commented Oct 28, 2022

I think you need to run make fix-copies on your side to adjust the READMEs, then it should be good to merge if all comments are addressed :-)

@pacman100
Copy link
Contributor

pacman100 commented Nov 2, 2022

Please address remaining comments along with steps Sylvain has mentioned and then we are good to go

@AkshitGulyan
Copy link
Contributor Author

Please address remaining comments along with steps Sylvain has mentioned and then we are good to go

Addressed all the comments and updated the file according to them !
Can you please help me understanding this fix-copies concept which Sylvain has mentioned as i dont know about it !

@pacman100
Copy link
Contributor

pacman100 commented Nov 7, 2022

Hello @AkshitGulyan, in the above PR I fixed subtle and time-consuming bugs to run make fix-copies without any issues. The details are below so that you can do these things next time.

  1. When I ran make fix-copies locally I got below error:
(ml) sourabmangrulkar@Sourabs-MacBook-Pro transformers % make fix-copies
python utils/check_copies.py --fix_and_overwrite
Traceback (most recent call last):
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 572, in <module>
    check_copies(args.fix_and_overwrite)
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 270, in check_copies
    check_model_list_copy(overwrite=overwrite)
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 455, in check_model_list_copy
    localized_md_list = get_model_list(filename, _start_prompt, _end_prompt)
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 303, in get_model_list
    while not lines[start_index].startswith(start_prompt):
IndexError: list index out of range
make: *** [fix-copies] Error 1
  1. After spending time diving into utils/check_copies.py found the issue wherein prompt_start specified was not matching to the line in README_hd.md. Made them same.

  2. Then got this issue:

Traceback (most recent call last):
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 354, in convert_to_localized_md
    localized_model_index = {
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 355, in <dictcomp>
    re.search(r"\*\*\[([^\]]*)", line).groups()[0]: line
AttributeError: 'NoneType' object has no attribute 'groups'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 575, in <module>
    check_copies(args.fix_and_overwrite)
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 270, in check_copies
    check_model_list_copy(overwrite=overwrite)
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 459, in check_model_list_copy
    readmes_match, converted_md_list = convert_to_localized_md(md_list, localized_md_list, _format_model_list)
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 359, in convert_to_localized_md
    raise AttributeError("A model name in localized READMEs cannot be recognized.")
AttributeError: A model name in localized READMEs cannot be recognized.
(ml) sourabmangrulkar@Sourabs-MacBook-Pro transformers % python utils/check_copies.py
Traceback (most recent call last):
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 351, in convert_to_localized_md
    localized_model_index = {
  File "/Users/sourabmangrulkar/Code/transformers/utils/check_copies.py", line 352, in <dictcomp>
    re.search(r"\*\*\[([^\]]*)", line).groups()[0]: line
AttributeError: 'NoneType' object has no attribute 'groups'

This was a subtle bug which took quite some time to figure out. You had improperly formatted the following models with improper spaces resulting in regex failing, below shows the buggy version:

1. ** [TrOCR] (https://huggingface.co/docs/transformers/model_doc/trocr) ** (from Microsoft) released with the paper [TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models](https://arxiv.org/abs/2109.10282) by Minghao Li, Tengchao Lv, Lei Cui, Yijuan Lu, Dinei Florencio, Cha Zhang, Zhoujun Li, Furu Wei.
1. ** [UL2] (https://huggingface.co/docs/transformers/model_doc/ul2) ** (from Google Research) released with the paper [Unifying Language Learning Paradigms](https://arxiv.org/abs/2205.05131v1) by Yi Tay, Mostafa Dehghani, Vinh Q. Tran, Xavier Garcia, Dara Bahri, Tal Schuster, Huaixiu Steven Zheng, Neil Houlsby, Donald Metzler 

So, after fixing it everything works as expected:

(ml) sourabmangrulkar@Sourabs-MacBook-Pro transformers % make fix-copies             
python utils/check_copies.py --fix_and_overwrite
python utils/check_table.py --fix_and_overwrite
python utils/check_dummies.py --fix_and_overwrite

Also, model list is very very inconsistent with some models having names in Hindi while others in English. Follow the format where all model names are in latin script instead of Devanagari script.

@pacman100
Copy link
Contributor

Hello @AkshitGulyan, please transfer the changes from above sample PR to this PR. Thank you and hope the above explanation clarifies the steps that Sylvain was suggesting.

@pacman100
Copy link
Contributor

Hello @AkshitGulyan, can you please reopen this PR and transfer the relevant changes from above sample PR to this PR.

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.

4 participants