



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


SCREAMING_SNAKE_CASE__       =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       =      {}


class      __lowerCAmelCase     (		UpperCAmelCase_      ):
					"""simple docstring"""






					A__				:		Optional[Any]			       =    "llama"
					A__				:		str			       =    ["past_key_values"]



					def __init__(     self					:       Union[str, Any]				,					_snake_case					:       str=3_20_00				,					_snake_case					:       int=40_96				,					_snake_case					:       Optional[int]=1_10_08				,					_snake_case					:       int=32				,					_snake_case					:       Optional[int]=32				,					_snake_case					:       Dict=None				,					_snake_case					:       Tuple="silu"				,					_snake_case					:       Union[str, Any]=20_48				,					_snake_case					:       Dict=0.02				,					_snake_case					:       List[str]=1E-6				,					_snake_case					:       str=True				,					_snake_case					:       int=0				,					_snake_case					:       List[Any]=1				,					_snake_case					:       Any=2				,					_snake_case					:       List[str]=1				,					_snake_case					:       Dict=False				,					_snake_case					:       Optional[Any]=None				,					**_snake_case					:       Any				,					):






								"""simple docstring"""


								A__       =    vocab_size
								A__       =    max_position_embeddings
								A__       =    hidden_size
								A__       =    intermediate_size
								A__       =    num_hidden_layers
								A__       =    num_attention_heads

								# for backward compatibility
								if num_key_value_heads is None:
											A__       =    num_attention_heads

								A__       =    num_key_value_heads
								A__       =    hidden_act
								A__       =    initializer_range
								A__       =    rms_norm_eps
								A__       =    pretraining_tp
								A__       =    use_cache
								A__       =    rope_scaling
								self._rope_scaling_validation()

								super().__init__(
								    pad_token_id=_snake_case				,					bos_token_id=_snake_case				,					eos_token_id=_snake_case				,					tie_word_embeddings=_snake_case				,					**_snake_case				,					)



					def     _a							(     self					:       List[str]					):






								"""simple docstring"""


								if self.rope_scaling is None:
											return

								if not isinstance(self.rope_scaling				,					_snake_case					) or len(self.rope_scaling					) != 2:
											raise ValueError(
											    '`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '
											    F'''got {self.rope_scaling}'''					)
								A__       =    self.rope_scaling.get('type'				,					_snake_case					)
								A__       =    self.rope_scaling.get('factor'				,					_snake_case					)
								if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
											raise ValueError(
											    F'''`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}'''					)
								if rope_scaling_factor is None or not isinstance(_snake_case				,					_snake_case					) or rope_scaling_factor <= 1.0:
											raise ValueError(F'''`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'''					)









import webbrowser
from sys import argv
from urllib.parse import parse_qs, quote

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
							SCREAMING_SNAKE_CASE__       =      '''%20'''.join(argv[1:]) if len(argv) > 1 else quote(str(input('''Search: ''')))

							print('''Googling.....''')

							SCREAMING_SNAKE_CASE__       =      f'https://www.google.com/search?q={query}&num=100'

							SCREAMING_SNAKE_CASE__       =      requests.get(
							    url,
							    headers={'''User-Agent''': str(UserAgent().random)},
							)

							try:
														SCREAMING_SNAKE_CASE__       =      (
														    BeautifulSoup(res.text, '''html.parser''')
														    .find('''div''', attrs={'''class''': '''yuRUbf'''})
														    .find('''a''')
														    .get('''href''')
														)

							except AttributeError:
														SCREAMING_SNAKE_CASE__       =      parse_qs(
														    BeautifulSoup(res.text, '''html.parser''')
														    .find('''div''', attrs={'''class''': '''kCrYT'''})
														    .find('''a''')
														    .get('''href''')
														)['''url'''][0]

							webbrowser.open(link)




