





from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCAmelCase             =							logging.get_logger(__name__)

_UpperCAmelCase             =							{
    'edbeeching/decision-transformer-gym-hopper-medium': (
        'https://huggingface.co/edbeeching/decision-transformer-gym-hopper-medium/resolve/main/config.json'
    ),
    # See all DecisionTransformer models at https://huggingface.co/models?filter=decision_transformer
}






class        snake_case_    (		_UpperCamelCase						):
  A_      							=   'decision_transformer'
  A_      							=   ['past_key_values']
  A_      							=   {
      'max_position_embeddings': 'n_positions',
      'num_attention_heads': 'n_head',
      'num_hidden_layers': 'n_layer',
  }






  def __init__(							self			:					int       ,  _snake_case			:					Optional[Any]=17       ,  _snake_case			:					Optional[Any]=4       ,  _snake_case			:					Any=128       ,  _snake_case			:					str=4096       ,  _snake_case			:					Union[str, Any]=True       ,  _snake_case			:					Dict=1       ,  _snake_case			:					Dict=1024       ,  _snake_case			:					List[str]=3       ,  _snake_case			:					Optional[int]=1       ,  _snake_case			:					str=None       ,  _snake_case			:					Dict="relu"       ,  _snake_case			:					Optional[Any]=0.1       ,  _snake_case			:					List[Any]=0.1       ,  _snake_case			:					int=0.1       ,  _snake_case			:					Dict=1E-5       ,  _snake_case			:					str=0.02       ,  _snake_case			:					List[Any]=True       ,  _snake_case			:					Union[str, Any]=True       ,  _snake_case			:					Any=50256       ,  _snake_case			:					List[str]=50256       ,  _snake_case			:					Tuple=False       ,  _snake_case			:					List[Any]=False       ,  **_snake_case			:					str       ,  )->Optional[Any]:






   '''simple docstring'''

   __lowerCAmelCase					:	Any      =       state_dim
   __lowerCAmelCase					:	Tuple      =       act_dim
   __lowerCAmelCase					:	List[Any]      =       hidden_size
   __lowerCAmelCase					:	str      =       max_ep_len
   __lowerCAmelCase					:	Dict      =       action_tanh
   __lowerCAmelCase					:	Union[str, Any]      =       vocab_size
   __lowerCAmelCase					:	Any      =       n_positions
   __lowerCAmelCase					:	List[str]      =       n_layer
   __lowerCAmelCase					:	Dict      =       n_head
   __lowerCAmelCase					:	Any      =       n_inner
   __lowerCAmelCase					:	List[str]      =       activation_function
   __lowerCAmelCase					:	str      =       resid_pdrop
   __lowerCAmelCase					:	Optional[int]      =       embd_pdrop
   __lowerCAmelCase					:	Optional[int]      =       attn_pdrop
   __lowerCAmelCase					:	Tuple      =       layer_norm_epsilon
   __lowerCAmelCase					:	Optional[Any]      =       initializer_range
   __lowerCAmelCase					:	Union[str, Any]      =       scale_attn_weights
   __lowerCAmelCase					:	int      =       use_cache
   __lowerCAmelCase					:	Tuple      =       scale_attn_by_inverse_layer_idx
   __lowerCAmelCase					:	int      =       reorder_and_upcast_attn

   __lowerCAmelCase					:	Optional[int]      =       bos_token_id
   __lowerCAmelCase					:	Union[str, Any]      =       eos_token_id

   super().__init__(bos_token_id=_SCREAMING_SNAKE_CASE       ,  eos_token_id=_SCREAMING_SNAKE_CASE       ,  **_SCREAMING_SNAKE_CASE      )








from datetime import datetime

import requests






def 	_SCREAMING_SNAKE_CASE		(      SCREAMING_SNAKE_CASE		:str   )      ->   bytes:
 __lowerCAmelCase					:	List[Any]      =       """https://downloadgram.net/wp-json/wppress/video-downloader/video?url="""
 __lowerCAmelCase					:	Dict      =       requests.get(base_url + url   ).json()[0]["""urls"""][0]["""src"""]
 return requests.get(SCREAMING_SNAKE_CASE   ).content


if __name__ == "__main__":
      _UpperCAmelCase             =							input('Enter Video/IGTV url: ').strip()
      _UpperCAmelCase             =							f'''{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4'''
      with open(file_name, 'wb') as fp:
            fp.write(download_video(url))
      print(f'''Done. Video saved to disk as {file_name}.''')