


"""simple docstring"""







import math
from typing import Optional

import torch
import torch.utils.checkpoint as checkpoint
from torch import nn

from ....modeling_utils import PreTrainedModel
from ....utils import add_start_docstrings, logging
from ...bert.modeling_bert import BertModel
from .configuration_retribert import RetriBertConfig


__a			 =   logging.get_logger(__name__)

__a			 =   [
    "yjernite/retribert-base-uncased",
    # See all RetriBert models at https://huggingface.co/models?filter=retribert
]
class 							lowerCamelCase       (			__SCREAMING_SNAKE_CASE ):


							"""simple docstring"""
							SCREAMING_SNAKE_CASE										=      RetriBertConfig
							SCREAMING_SNAKE_CASE										=      None
							SCREAMING_SNAKE_CASE										=      """retribert"""






							def 					lowerCAmelCase     (						self :     List[Any]		, lowerCamelCase_ :     Any				):
													if isinstance(lowerCamelCase_		, nn.Linear				):
																			module.weight.data.normal_(mean=0.0		, std=self.config.initializer_range				)
																			if module.bias is not None:
																									module.bias.data.zero_()
													elif isinstance(lowerCamelCase_		, nn.Embedding				):
																			module.weight.data.normal_(mean=0.0		, std=self.config.initializer_range				)
																			if module.padding_idx is not None:
																									module.weight.data[module.padding_idx].zero_()
													elif isinstance(lowerCamelCase_		, nn.LayerNorm				):
																			module.bias.data.zero_()
																			module.weight.data.fill_(1.0				)




__a			 =   r"\n\n    This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the\n    library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads\n    etc.)\n\n    This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.\n    Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage\n    and behavior.\n\n    Parameters:\n        config ([`RetriBertConfig`]): Model configuration class with all the parameters of the model.\n            Initializing with a config file does not load the weights associated with the model, only the\n            configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.\n"
@add_start_docstrings(
    """Bert Based model to embed queries or document for document retrieval."""				,					__SCREAMING_SNAKE_CASE				,					)
class 							lowerCamelCase       (			__SCREAMING_SNAKE_CASE ):


							"""simple docstring"""






							def __init__(						self :     int		, lowerCamelCase_ :     RetriBertConfig				):
													super().__init__(lowerCamelCase_				)
													UpperCAmelCase__		=    config.projection_dim

													UpperCAmelCase__		=    BertModel(lowerCamelCase_				)
													UpperCAmelCase__		=    None if config.share_encoders else BertModel(lowerCamelCase_				)
													UpperCAmelCase__		=    nn.Dropout(config.hidden_dropout_prob				)
													UpperCAmelCase__		=    nn.Linear(config.hidden_size		, config.projection_dim		, bias=lowerCamelCase_				)
													UpperCAmelCase__		=    nn.Linear(config.hidden_size		, config.projection_dim		, bias=lowerCamelCase_				)

													UpperCAmelCase__		=    nn.CrossEntropyLoss(reduction='''mean'''				)

													# Initialize weights and apply final processing
													self.post_init()






							def 					lowerCAmelCase     (						self :     Union[str, Any]		, lowerCamelCase_ :     Dict		, lowerCamelCase_ :     Tuple		, lowerCamelCase_ :     int		, lowerCamelCase_ :     str=-1		, ):
													# reproduces BERT forward pass with checkpointing
													if checkpoint_batch_size < 0 or input_ids.shape[0] < checkpoint_batch_size:
																			return sent_encoder(lowerCamelCase_		, attention_mask=lowerCamelCase_				)[1]
													else:
																			# prepare implicit variables
																			UpperCAmelCase__		=    input_ids.device
																			UpperCAmelCase__		=    input_ids.size()
																			UpperCAmelCase__		=    torch.zeros(lowerCamelCase_		, dtype=torch.long		, device=lowerCamelCase_				)
																			UpperCAmelCase__		=    [None] * sent_encoder.config.num_hidden_layers
																			UpperCAmelCase__		=    sent_encoder.get_extended_attention_mask(
																			    lowerCamelCase_		, lowerCamelCase_				)

																			# define function for checkpointing
																			def partial_encode(*lowerCamelCase_ :     str				):
																									UpperCAmelCase__		=    sent_encoder.encoder(
																									    inputs[0]		, attention_mask=inputs[1]		, head_mask=lowerCamelCase_		, )
																									UpperCAmelCase__		=    encoder_outputs[0]
																									UpperCAmelCase__		=    sent_encoder.pooler(lowerCamelCase_				)
																									return pooled_output

																			# run embedding layer on everything at once
																			UpperCAmelCase__		=    sent_encoder.embeddings(
																			    input_ids=lowerCamelCase_		, position_ids=lowerCamelCase_		, token_type_ids=lowerCamelCase_		, inputs_embeds=lowerCamelCase_				)
																			# run encoding and pooling on one mini-batch at a time
																			UpperCAmelCase__		=    []
																			for b in range(math.ceil(input_ids.shape[0] / checkpoint_batch_size				)				):
																									UpperCAmelCase__		=    embedding_output[b * checkpoint_batch_size : (b + 1) * checkpoint_batch_size]
																									UpperCAmelCase__		=    extended_attention_mask[b * checkpoint_batch_size : (b + 1) * checkpoint_batch_size]
																									UpperCAmelCase__		=    checkpoint.checkpoint(lowerCamelCase_		, lowerCamelCase_		, lowerCamelCase_				)
																									pooled_output_list.append(lowerCamelCase_				)
																			return torch.cat(lowerCamelCase_		, dim=0				)






							def 					lowerCAmelCase     (						self :     Optional[int]		, lowerCamelCase_ :     Optional[int]		, lowerCamelCase_ :     Optional[Any]=None		, lowerCamelCase_ :     Any=-1		, ):
													UpperCAmelCase__		=    self.embed_sentences_checkpointed(
													    lowerCamelCase_		, lowerCamelCase_		, self.bert_query		, lowerCamelCase_		, )
													return self.project_query(lowerCamelCase_				)






							def 					lowerCAmelCase     (						self :     Any		, lowerCamelCase_ :     List[str]		, lowerCamelCase_ :     List[str]=None		, lowerCamelCase_ :     Dict=-1		, ):
													UpperCAmelCase__		=    self.embed_sentences_checkpointed(
													    lowerCamelCase_		, lowerCamelCase_		, self.bert_query if self.bert_doc is None else self.bert_doc		, lowerCamelCase_		, )
													return self.project_doc(lowerCamelCase_				)






							def 					lowerCAmelCase     (						self :     Tuple		, lowerCamelCase_ :     torch.LongTensor		, lowerCamelCase_ :     Optional[torch.FloatTensor]		, lowerCamelCase_ :     torch.LongTensor		, lowerCamelCase_ :     Optional[torch.FloatTensor]		, lowerCamelCase_ :     int = -1		, ):
													UpperCAmelCase__		=    input_ids_query.device
													UpperCAmelCase__		=    self.embed_questions(lowerCamelCase_		, lowerCamelCase_		, lowerCamelCase_				)
													UpperCAmelCase__		=    self.embed_answers(lowerCamelCase_		, lowerCamelCase_		, lowerCamelCase_				)
													UpperCAmelCase__		=    torch.mm(lowerCamelCase_		, a_reps.t()				)
													UpperCAmelCase__		=    self.ce_loss(lowerCamelCase_		, torch.arange(compare_scores.shape[1]				).to(lowerCamelCase_				)				)
													UpperCAmelCase__		=    self.ce_loss(compare_scores.t()		, torch.arange(compare_scores.shape[0]				).to(lowerCamelCase_				)				)
													UpperCAmelCase__		=    (loss_qa + loss_aq) / 2
													return loss



"""simple docstring"""







import argparse
import gc
import os
import sys
from pathlib import Path
from typing import List  # noqa: F401

import pytorch_lightning as pl
import torch
from finetune import SummarizationModule, TranslationModule
from finetune import main as ft_main
from make_student import create_student_by_copying_alternating_layers, get_layers_to_supervise
from torch import nn

from transformers import AutoModelForSeqaSeqLM, MBartTokenizer, TaForConditionalGeneration
from transformers.models.bart.modeling_bart import shift_tokens_right
from utils import calculate_bleu, check_output_dir, freeze_params, label_smoothed_nll_loss, use_task_specific_params


# need the parent dir module
sys.path.insert(2, str(Path(__file__).resolve().parents[1]))
from lightning_base import generic_train  # noqa
class 							lowerCamelCase       (			__SCREAMING_SNAKE_CASE ):


							"""simple docstring"""
							SCREAMING_SNAKE_CASE										=      ["""loss""", """ce_loss""", """mlm_loss""", """hid_loss_enc""", """hid_loss_dec"""]






							def __init__(						self :     int		, lowerCamelCase_ :     Tuple				):
													assert Path(hparams.data_dir				).exists()
													UpperCAmelCase__		=    Path(hparams.output_dir				)
													self.output_dir.mkdir(exist_ok=lowerCamelCase_				)

													UpperCAmelCase__		=    self.output_dir.joinpath('''student'''				)

													UpperCAmelCase__		=    str(lowerCamelCase_				)  # Tell lightning we are training the student
													UpperCAmelCase__		=    AutoModelForSeqaSeqLM.from_pretrained(hparams.teacher				).eval()
													use_task_specific_params(lowerCamelCase_		, hparams.task				)  # We copy good generation parameters to student by default
													if hparams.student is not None:
																			UpperCAmelCase__		=    AutoModelForSeqaSeqLM.from_pretrained(hparams.student				)
																			use_task_specific_params(lowerCamelCase_		, hparams.task				)
																			UpperCAmelCase__	,				UpperCAmelCase__		=    None, None
													else:
																			UpperCAmelCase__	,				UpperCAmelCase__	,				UpperCAmelCase__		=    create_student_by_copying_alternating_layers(
																			    lowerCamelCase_		, e=hparams.student_encoder_layers		, d=hparams.student_decoder_layers		, save_path=lowerCamelCase_				)

													if hparams.length_penalty != -1:
																			UpperCAmelCase__		=    hparams.length_penalty
													UpperCAmelCase__		=    hparams.teacher  # Use teacher's tokenizer
													super().__init__(lowerCamelCase_		, model=lowerCamelCase_		, config=student.config				)
													assert student.config.model_type == teacher.config.model_type, (
													    f"""teacher, student model types should be the same, got {student.config.model_type} !="""
													    f""" {teacher.config.model_type}"""
													)

													if student.config.model_type == "t5":
																			UpperCAmelCase__		=    len(student.get_encoder().block				)
																			UpperCAmelCase__		=    len(student.get_decoder().block				)
																			UpperCAmelCase__		=    len(teacher.get_encoder().block				)
																			UpperCAmelCase__		=    len(teacher.get_decoder().block				)
													else:
																			UpperCAmelCase__		=    student.config.encoder_layers
																			UpperCAmelCase__		=    student.config.decoder_layers
																			UpperCAmelCase__		=    teacher.config.encoder_layers
																			UpperCAmelCase__		=    teacher.config.decoder_layers

													UpperCAmelCase__		=    not (hparams.student is None or hparams.teacher == hparams.student)
													UpperCAmelCase__		=    (not self.different_base_models) and hparams.alpha_hid > 0
													UpperCAmelCase__		=    self.different_base_models or (student_encoder_layers != teacher_encoder_layers)
													# self.different_encoder determines whether we need to run the teacher encoder
													UpperCAmelCase__		=    teacher
													freeze_params(self.teacher				)

													if not self.different_encoder:  # To save RAM, delete teacher encoder and freeze student encoder.
																			try:
																									del self.teacher.model.encoder
																			except AttributeError:  # T5
																									del self.teacher.encoder

													if e_layer_ids is None:
																			UpperCAmelCase__		=    list(range(lowerCamelCase_				)				)
													if d_layer_ids is None:
																			UpperCAmelCase__		=    list(range(lowerCamelCase_				)				)

													UpperCAmelCase__	,				UpperCAmelCase__		=    e_layer_ids, d_layer_ids  # type: List[int], List[int]

													if self.do_calc_hidden_loss:  # Intermediate supervision: Decide which layers to supervise
																			if hparams.supervise_forward:
																									UpperCAmelCase__		=    get_layers_to_supervise(
																									    n_student=len(self.e_layer_ids				)		, n_teacher=lowerCamelCase_				)
																									UpperCAmelCase__		=    get_layers_to_supervise(
																									    n_student=len(self.d_layer_ids				)		, n_teacher=lowerCamelCase_				)
																			else:  # student layer should emulate hidden states of the teacher layer it was copied from
																									UpperCAmelCase__		=    self.e_layer_ids
																									UpperCAmelCase__		=    self.d_layer_ids
													else:
																			UpperCAmelCase__		=    None
																			UpperCAmelCase__		=    None

													UpperCAmelCase__		=    nn.KLDivLoss(reduction='''batchmean'''				)
													UpperCAmelCase__		=    2.0
													UpperCAmelCase__		=    hparams.alpha_mlm
													UpperCAmelCase__		=    hparams.alpha_ce
													UpperCAmelCase__		=    hparams.alpha_hid
													gc.collect()
													torch.cuda.empty_cache()






							def 					lowerCAmelCase     (						self :     Any		, lowerCamelCase_ :     Any		, lowerCamelCase_ :     Dict		, lowerCamelCase_ :     Union[str, Any]				):
													UpperCAmelCase__		=    mask[:, :, None].expand_as(lowerCamelCase_				)
													UpperCAmelCase__		=    s_logits.size(-1				)
													UpperCAmelCase__		=    torch.masked_select(lowerCamelCase_		, lowerCamelCase_				)  # (bs * seq_length * voc_size) modulo the 1s in mask
													UpperCAmelCase__		=    torch.masked_select(lowerCamelCase_		, lowerCamelCase_				)  # (bs * seq_length * voc_size) modulo the 1s in mask
													UpperCAmelCase__		=    s_logits_slct.view(-1		, lowerCamelCase_				)  # (bs * seq_length, voc_size) modulo the 1s in mask
													UpperCAmelCase__		=    t_logits_slct.view(-1		, lowerCamelCase_				)  # (bs * seq_length, voc_size) modulo the 1s in mask
													assert t_logits_slct.size() == s_logits_slct.size()
													UpperCAmelCase__		=    (
													    self.ce_loss_fct(
													        nn.functional.log_softmax(s_logits_slct / self.temperature		, dim=-1				)		, nn.functional.softmax(t_logits_slct / self.temperature		, dim=-1				)		, )
													    * (self.temperature) ** 2
													)
													return loss_ce






							@staticmethod
							def 					lowerCAmelCase     (						lowerCamelCase_ :     int		, lowerCamelCase_ :     Optional[Any]				):
													SummarizationModule.add_model_specific_args(lowerCamelCase_		, lowerCamelCase_				)
													add_distill_args(lowerCamelCase_				)
													return parser






							def 					lowerCAmelCase     (						self :     Dict		, lowerCamelCase_ :     dict				):
													UpperCAmelCase__		=    self.tokenizer.pad_token_id
													UpperCAmelCase__	,				UpperCAmelCase__	,				UpperCAmelCase__		=    batch['''input_ids'''], batch['''attention_mask'''], batch['''labels''']
													if isinstance(self.model		, lowerCamelCase_				):
																			UpperCAmelCase__		=    self.model._shift_right(lowerCamelCase_				)
													else:
																			UpperCAmelCase__		=    shift_tokens_right(lowerCamelCase_		, lowerCamelCase_				)

													# noinspection PyCallingNonCallable
													UpperCAmelCase__		=    self(
													    lowerCamelCase_		, attention_mask=lowerCamelCase_		, decoder_input_ids=lowerCamelCase_		, output_hidden_states=self.do_calc_hidden_loss		, output_attentions=lowerCamelCase_		, use_cache=lowerCamelCase_		, )
													UpperCAmelCase__		=    student_outputs['''logits''']

													# Same cross entropy vs. label smoothing logic as finetune.py
													assert lm_logits.shape[-1] == self.model.config.vocab_size
													if self.hparams.label_smoothing == 0:
																			# Same behavior as modeling_bart.py, besides ignoring pad_token_id
																			UpperCAmelCase__		=    nn.CrossEntropyLoss(ignore_index=lowerCamelCase_				)
																			UpperCAmelCase__		=    loss_fct(lm_logits.view(-1		, lm_logits.shape[-1]				)		, labels.view(-1				)				)
													else:
																			UpperCAmelCase__		=    nn.functional.log_softmax(lowerCamelCase_		, dim=-1				)
																			UpperCAmelCase__	,				UpperCAmelCase__		=    label_smoothed_nll_loss(
																			    lowerCamelCase_		, lowerCamelCase_		, self.hparams.label_smoothing		, ignore_index=lowerCamelCase_				)

													def zero_tensor():
																			return torch.tensor(0.0				).type_as(lowerCamelCase_				)

													UpperCAmelCase__		=    student_outputs[
													    '''encoder_last_hidden_state'''
													]  # use this unless self.different_base_models
													UpperCAmelCase__	,				UpperCAmelCase__		=    zero_tensor(), zero_tensor()
													if self.different_encoder:  # compute encoder hidden state loss
																			UpperCAmelCase__		=    self.teacher.get_encoder()(
																			    lowerCamelCase_		, attention_mask=lowerCamelCase_		, output_hidden_states=self.do_calc_hidden_loss		, )
																			if self.different_base_models:
																									UpperCAmelCase__		=    all_teacher_encoder_outputs['''last_hidden_state''']
																			elif self.do_calc_hidden_loss:
																									UpperCAmelCase__		=    self.calc_hidden_loss(
																									    lowerCamelCase_		, student_outputs['''encoder_hidden_states''']		, all_teacher_encoder_outputs['''hidden_states''']		, self.e_matches		, normalize_hidden=self.hparams.normalize_hidden		, )

													UpperCAmelCase__		=    self.teacher(
													    lowerCamelCase_		, attention_mask=lowerCamelCase_		, encoder_outputs=(teacher_enc_outputs,)		, decoder_input_ids=lowerCamelCase_		, output_hidden_states=self.do_calc_hidden_loss		, use_cache=lowerCamelCase_		, )
													UpperCAmelCase__		=    decoder_input_ids.ne(lowerCamelCase_				)
													UpperCAmelCase__		=    self.calc_ce_loss(lowerCamelCase_		, lowerCamelCase_		, teacher_outputs['''logits''']				)
													if self.do_calc_hidden_loss:  # Intermediate supervision of decoder hidden states
																			UpperCAmelCase__		=    self.calc_hidden_loss(
																			    lowerCamelCase_		, student_outputs['''decoder_hidden_states''']		, teacher_outputs['''decoder_hidden_states''']		, self.d_matches		, normalize_hidden=self.hparams.normalize_hidden		, )

													UpperCAmelCase__		=    (
													    self.alpha_ce * loss_ce
													    + self.alpha_mlm * student_lm_loss
													    + self.hparams.alpha_hid * (hid_loss_enc + hid_loss_dec)
													)
													return blended_loss, loss_ce, student_lm_loss, hid_loss_enc, hid_loss_dec






							@staticmethod
							def 					lowerCAmelCase     (						lowerCamelCase_ :     Optional[Any]		, lowerCamelCase_ :     Optional[Any]		, lowerCamelCase_ :     int		, lowerCamelCase_ :     Optional[Any]		, lowerCamelCase_ :     int				):
													UpperCAmelCase__		=    '''expected list or tuple for hidden_states, got tensor of shape: '''
													assert not isinstance(lowerCamelCase_		, torch.Tensor				), f"""{msg}{hidden_states.shape}"""
													assert not isinstance(lowerCamelCase_		, torch.Tensor				), f"""{msg}{hidden_states_T.shape}"""
													UpperCAmelCase__		=    attention_mask.to(hidden_states[0]				)
													UpperCAmelCase__		=    mask.sum() * hidden_states[0].size(-1				)
													UpperCAmelCase__		=    torch.stack([hidden_states[i] for i in range(len(lowerCamelCase_				)				)]				)
													UpperCAmelCase__		=    torch.stack([hidden_states_T[j] for j in matches]				)
													assert student_states.shape == teacher_states.shape, f"""{student_states.shape} != {teacher_states.shape}"""
													if normalize_hidden:
																			UpperCAmelCase__		=    nn.functional.layer_norm(lowerCamelCase_		, student_states.shape[1:]				)
																			UpperCAmelCase__		=    nn.functional.layer_norm(lowerCamelCase_		, teacher_states.shape[1:]				)
													UpperCAmelCase__		=    nn.functional.mse_loss(lowerCamelCase_		, lowerCamelCase_		, reduction='''none'''				)
													UpperCAmelCase__		=    (mse * mask.unsqueeze(0				).unsqueeze(-1				)).sum() / valid_count
													return masked_mse






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						parser.add_argument('''--teacher'''	,			type=_UpperCamelCase )
						parser.add_argument('''--alpha_ce'''	,			default=0.8	,			type=_UpperCamelCase )
						parser.add_argument('''--alpha_mlm'''	,			default=0.2	,			type=_UpperCamelCase )
						parser.add_argument('''--alpha_hid'''	,			default=0.0	,			type=_UpperCamelCase	,			required=_UpperCamelCase )
						parser.add_argument('''--student'''	,			type=_UpperCamelCase	,			required=_UpperCamelCase )
						parser.add_argument('''--student_decoder_layers'''	,			default=12	,			type=_UpperCamelCase	,			required=_UpperCamelCase )
						parser.add_argument('''--student_encoder_layers'''	,			default=12	,			type=_UpperCamelCase	,			required=_UpperCamelCase )
						parser.add_argument('''--no_teacher'''	,			action='''store_true'''	,			default=_UpperCamelCase )
						parser.add_argument('''--length_penalty'''	,			type=_UpperCamelCase	,			default=-1 )
						parser.add_argument('''--supervise_forward'''	,			action='''store_true'''	,			default=_UpperCamelCase )
						parser.add_argument('''--normalize_hidden'''	,			action='''store_true'''	,			default=_UpperCamelCase )
class 							lowerCamelCase       (			__SCREAMING_SNAKE_CASE ):


							"""simple docstring"""
							SCREAMING_SNAKE_CASE										=      """translation"""
							SCREAMING_SNAKE_CASE										=      ["""bleu"""]
							SCREAMING_SNAKE_CASE										=      """bleu"""






							def __init__(						self :     Any		, lowerCamelCase_ :     Any		, **lowerCamelCase_ :     str				):
													super().__init__(lowerCamelCase_		, **lowerCamelCase_				)
													assert hparams.src_lang is not None
													assert hparams.tgt_lang is not None
													UpperCAmelCase__		=    hparams.src_lang
													UpperCAmelCase__		=    hparams.tgt_lang
													if self.model.config.decoder_start_token_id is None and isinstance(self.tokenizer		, lowerCamelCase_				):
																			UpperCAmelCase__		=    self.tokenizer.lang_code_to_id[hparams.tgt_lang]






							def 					lowerCAmelCase     (						self :     Any		, lowerCamelCase_ :     List[str]		, lowerCamelCase_ :     int				):
													return calculate_bleu(lowerCamelCase_		, lowerCamelCase_				)






							@staticmethod
							def 					lowerCAmelCase     (						lowerCamelCase_ :     List[Any]		, lowerCamelCase_ :     str				):
													TranslationModule.add_model_specific_args(lowerCamelCase_		, lowerCamelCase_				)
													add_distill_args(lowerCamelCase_				)
													return parser






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						if args.no_teacher:
												UpperCAmelCase__		=    TranslationModule if '''translation''' in args.task else SummarizationModule
						else:  # DISTILL WITH TEACHER
												UpperCAmelCase__		=    TranslationDistiller if '''translation''' in args.task else SummarizationDistiller
						UpperCAmelCase__		=    module_cls.__name__
						print(F"""using module {args.setup_cls}""" )
						UpperCAmelCase__		=    module_cls(_UpperCamelCase )
						return model






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						Path(args.output_dir ).mkdir(exist_ok=_UpperCamelCase )
						check_output_dir(_UpperCamelCase	,			expected_items=3 )

						UpperCAmelCase__		=    create_module(_UpperCamelCase )
						return ft_main(_UpperCamelCase	,			model=_UpperCamelCase )


if __name__ == "__main__":
						__a			 =   argparse.ArgumentParser()
						__a			 =   pl.Trainer.add_argparse_args(parser)
						__a			 =   SummarizationDistiller.add_model_specific_args(parser, os.getcwd())
						__a			 =   parser.parse_args()

						distill_main(args)