Add ESM to huggingface
Author: liujas000
Pull request: yes

# What does this PR do?

Adding ESM-1b to huggingface following the steps in https://huggingface.co/transformers/add_new_model.html



## 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](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [ ] 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.
@sgugger

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->


Comments:
@sgugger , thanks for the feedback!
There's two common tests that I'm failing; do you have any insight into what the proper fix would be?
```
❯ pytest tests/test_modeling_esm.py --disable-warnings
==================================================== test session starts ====================================================
platform linux -- Python 3.7.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /private/home/jasonliu/work-huggingface/transformers-dev, configfile: setup.cfg
plugins: dash-1.21.0, forked-1.3.0, xdist-2.3.0, timeout-1.4.2, hydra-core-1.1.0
collected 67 items

tests/test_modeling_esm.py .....................................s..............FF.....sss..ss.                        [100%]

========================================================= FAILURES ==========================================================
______________________________________ ESMModelTest.test_save_load_fast_init_from_base ______________________________________

self = <tests.test_modeling_esm.ESMModelTest testMethod=test_save_load_fast_init_from_base>

    def test_save_load_fast_init_from_base(self):
        config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
>       base_class = MODEL_MAPPING[config.__class__]

tests/test_modeling_common.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = _LazyAutoMapping(), key = <class 'transformers.models.esm.configuration_esm.ESMConfig'>

    def __getitem__(self, key):
>       model_type = self._reverse_config_mapping[key.__name__]
E       KeyError: 'ESMConfig'

src/transformers/models/auto/auto_factory.py:513: KeyError
_______________________________________ ESMModelTest.test_save_load_fast_init_to_base _______________________________________

self = <tests.test_modeling_esm.ESMModelTest testMethod=test_save_load_fast_init_to_base>

    def test_save_load_fast_init_to_base(self):
        config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
>       base_class = MODEL_MAPPING[config.__class__]

tests/test_modeling_common.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = _LazyAutoMapping(), key = <class 'transformers.models.esm.configuration_esm.ESMConfig'>

    def __getitem__(self, key):
>       model_type = self._reverse_config_mapping[key.__name__]
E       KeyError: 'ESMConfig'

src/transformers/models/auto/auto_factory.py:513: KeyError
================================================== short test summary info ==================================================
FAILED tests/test_modeling_esm.py::ESMModelTest::test_save_load_fast_init_from_base - KeyError: 'ESMConfig'
FAILED tests/test_modeling_esm.py::ESMModelTest::test_save_load_fast_init_to_base - KeyError: 'ESMConfig'
============================== 2 failed, 59 passed, 6 skipped, 30 warnings in 99.74s (0:01:39) ==============================
```

It doesn't look like you added your model in the configuration_auto mappings, just the modeling_auto mappings. That's why you get this error.

Thanks! I think this is ready for review again (rebased to upstream)

Hey @liujas000, 

Can we help you in any way to get this PR merged? :-)

@patrickvonplaten sorry for the delay; I will land this week!

Test failure seems unrelated

Thanks a lot for making this PR more or less mergeable @liujas000 . I think there are just some final comments from @sgugger and @patrickvonplaten to be taken care of and the PR is good to go :-)

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.

I'd love to use this model, what still needs to be done to get this merged?

cc @liujas000 @Rocketknight1 

@gianhiltbrunner We're still waiting on an internal review from Facebook from the contributors, I believe! I'll let you know if there's any update.

I would also be very happy if this gets merged! Any progress?

Any updates here?