




import tempfile
import unittest

from make_student import create_student_by_copying_alternating_layers

from transformers import AutoConfig
from transformers.file_utils import cached_property
from transformers.testing_utils import require_torch


_UpperCAmelCase		:  Optional[int]	=   "sshleifer/bart-tiny-random"
_UpperCAmelCase		:  Union[str, Any]	=   "patrickvonplaten/t5-tiny-random"




@require_torch
class       __lowerCAmelCase				(							unittest.TestCase):






       @cached_property
       def     SCREAMING_SNAKE_CASE			(      self:    Any ):
         return AutoConfig.from_pretrained(_lowerCAmelCase )






       def     SCREAMING_SNAKE_CASE			(      self:    Union[str, Any] ):
         lowercase		,			*lowercase			:Optional[int]							=  create_student_by_copying_alternating_layers(_lowerCAmelCase				,    tempfile.mkdtemp()				,    e=1				,    d=1 )
         self.assertEqual(student.config.num_hidden_layers				,    1 )






       def     SCREAMING_SNAKE_CASE			(      self:    int ):
         lowercase		,			*lowercase			:List[Any]							=  create_student_by_copying_alternating_layers(_lowerCAmelCase				,    tempfile.mkdtemp()				,    e=1				,    d=_lowerCAmelCase )






       def     SCREAMING_SNAKE_CASE			(      self:    str ):
         lowercase		,			*lowercase			:List[Any]							=  create_student_by_copying_alternating_layers(_lowerCAmelCase				,    tempfile.mkdtemp()				,    e=1				,    d=_lowerCAmelCase )
         self.assertEqual(student.config.encoder_layers				,    1 )
         self.assertEqual(student.config.decoder_layers				,    self.teacher_config.encoder_layers )






       def     SCREAMING_SNAKE_CASE			(      self:    Union[str, Any] ):
         lowercase		,			*lowercase			:Optional[int]							=  create_student_by_copying_alternating_layers(_lowerCAmelCase				,    tempfile.mkdtemp()				,    e=1				,    d=1 )
         self.assertEqual(student.config.encoder_layers				,    1 )
         self.assertEqual(student.config.decoder_layers				,    1 )






       def     SCREAMING_SNAKE_CASE			(      self:    Tuple ):
         with self.assertRaises(_lowerCAmelCase ):
           create_student_by_copying_alternating_layers(_lowerCAmelCase				,    tempfile.mkdtemp()				,    e=_lowerCAmelCase				,    d=_lowerCAmelCase )









import os
from math import logaa



def 					UpperCAmelCase__     (   lowerCamelCase = "base_exp.txt"      ):
  lowercase			:float							=  0
  lowercase			:str							=  0
  for i, line in enumerate(open(os.path.join(os.path.dirname(lowerCamelCase      ),	lowerCamelCase      )      )      ):
    lowercase		,			lowercase			:str							=  list(map(lowerCamelCase,	line.split(","      )      )      )
    if x * logaa(lowerCamelCase      ) > largest:
      lowercase			:Optional[Any]							=  x * logaa(lowerCamelCase      )
      lowercase			:Any							=  i + 1
  return result


if __name__ == "__main__":
     print(solution())



