# Implementation source code for AutoModelForSeq2SeqLM

**URL:** <https://discuss.huggingface.co/t/implementation-source-code-for-automodelforseq2seqlm/13387>\
**Category:** Beginners\
**Created:** [January 5, 2022, 7:24am UTC](https://discuss.huggingface.co/t/implementation-source-code-for-automodelforseq2seqlm/13387 "2022-01-05T07:24:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slecraphi](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@slecraphi](https://discuss.huggingface.co/u/slecraphi)\
**Post date:** [January 5, 2022, 7:24am UTC](https://discuss.huggingface.co/t/implementation-source-code-for-automodelforseq2seqlm/13387/1 "2022-01-05T07:24:28Z")

</div>

This is probally a source code tracing problem.

I was using `AutoModelForSeq2SeqLM` for summarization task, and I want to know the Transformers implemention detail of the `AutoModelForSeq2SeqLM ` model, from base model(e.g. BART, T5) output.

For example, for `BertForSequenceClassification`, I want to find the source code like below: (from [src/transformers/models/bert.py](https://github.com/huggingface/transformers/blob/b5e2b183af5e40e33a4dc7659e697d137259d56e/src/transformers/models/bert/modeling_bert.py#L1501))

```auto
class BertForSequenceClassification(BertPreTrainedModel):
    def __init__ (self, config):
        super(). __init__ (config)
        self.num_labels = config.num_labels
        self.config = config

        self.bert = BertModel(config)
        self.dropout = nn.Dropout(config.hidden_dropout_prob)
        self.classifier = nn.Linear(config.hidden_size, config.num_labels)

        self.init_weights()

```

I tried search for `AutoModelForSeq2SeqLM` on github, but I can’t find something similar.

I tried finding from `src/transformers/models/t5.py`(also bart.py), the most similar thing is `T5ForConditionalGeneration`, but I can’t find the where AutoModelForSeq2SeqLM connect with `T5ForConditionalGeneration`.

Thank you for your help!
