Add basic eval table logging for WandbCallback
Author: andrewtruong
Pull request: yes

# What does this PR do?
This PR adds basic support for logging raw evals using `WandbCallback`.
1. Calling `trainer.evaluate()` will log an eval table with inputs and outputs; and
2. Logging is controlled by the `WANDB_LOG_EVALS` env var.

This also adds some changes to trainer internals to support this, including:
1. Updates `EvalLoopOutputs` to include `inputs`
2. Automatically adds a ref to the trainer when instantiating callbacks

Here's an example table that gets logged when the user calls `trainer.evaluate()`
![image](https://github.com/huggingface/transformers/assets/15385696/17918541-8b84-4437-918d-1d97d812ddf3)



<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Fixes # (issue)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      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.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/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.

@amyeroberts are you the right person to review?

<!-- 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:

- text models: @ArthurZucker and @younesbelkada
- vision models: @amyeroberts
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @muellerzr and @pacman100

Integrations:

- deepspeed: HF Trainer/Accelerate: @pacman100
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc and @younesbelkada

Documentation: @stevhliu and @MKhalusova

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
I'm not sure how to get the failing tests to pass, even on `main`.  Am I missing something?

Failing tests are:
- `tests/utils/test_offline.py::OfflineTests::test_offline_mode`
- `tests/utils/test_offline.py::OfflineTests::test_offline_mode_sharded_checkpoint`
- `tests/utils/test_offline.py::OfflineTests::test_offline_model_dynamic_model`

This PR also makes 2 changes to the trainer internals that could be split into their own PRs:
- [add inputs to `EvalLoopOutputs`](https://github.com/huggingface/transformers/pull/31050/commits/c218cfb8daaed9d3fac6e2c380079df9f0b2cc79)
- [add a ref to the trainer that callbacks are attached to](https://github.com/huggingface/transformers/pull/31050/commits/cd9dbf5709eabe762bf7946d7f35c63ce5718a31)

Hi @amyeroberts!

Sorry to bother -- are you the right person to take a look at this?

Hi @andrewtruong, thanks for opening this PR! 

I'm going bring in @muellerzr here, who knows far more about Trainer and its interactions with W&B. One thing to note, is that integrations like W&B aren't actively maintained by the Hugging Face team. Looking at the PR, I'm not sure we want to add attributes to core objects like Trainer to enable feature integrations, unless it would unlock other things (here @muellerzr can definitely advise!) 

Thanks!

I'm hoping these are small and reasonable changes:
1. It doesn't touch the public Trainer API, only an internal object `EvalLoopOutput`.  In that case, it just surfaces as variable that was already there but not exposed.
2. It adds a reference back to the trainer from a callback, which can be useful if e.g. you need to get the tokenizer or dataset which are passed into the Trainer but not into the callback.

Hey @muellerzr, any chance you can take a look this week?  I'd love to get this in :)

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_31050). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Hey @muellerzr any feedback?

@andrewtruong can you fix the conflicts then @amyeroberts can give it a final review!

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/main/CONTRIBUTING.md) are likely to be ignored.