





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


_SCREAMING_SNAKE_CASE      	=		logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE      	=		{}
class SCREAMING_SNAKE_CASE_						(					_A					):
						__magic_name__:			str       =       "llama"
						__magic_name__:			Any       =       ["past_key_values"]






						def __init__(      self      :      List[str]		,   _A      :      Optional[Any]=32000		,   _A      :      Union[str, Any]=4096		,   _A      :      Tuple=11008		,   _A      :      List[Any]=32		,   _A      :      Union[str, Any]=32		,   _A      :      Dict=None		,   _A      :      List[Any]="silu"		,   _A      :      Optional[int]=2048		,   _A      :      Union[str, Any]=0.0_2		,   _A      :      Optional[Any]=1E-6		,   _A      :      List[str]=True		,   _A      :      List[str]=0		,   _A      :      Dict=1		,   _A      :      Union[str, Any]=2		,   _A      :      Tuple=1		,   _A      :      int=False		,   _A      :      List[str]=None		,   **_A      :      Tuple		,   )							->    Tuple:







							"""simple docstring"""


							snake_case_		:			int											=	vocab_size
							snake_case_		:			Any											=	max_position_embeddings
							snake_case_		:			int											=	hidden_size
							snake_case_		:			List[Any]											=	intermediate_size
							snake_case_		:			int											=	num_hidden_layers
							snake_case_		:			Union[str, Any]											=	num_attention_heads

							# for backward compatibility
							if num_key_value_heads is None:
								snake_case_		:			Dict											=	num_attention_heads

							snake_case_		:			List[str]											=	num_key_value_heads
							snake_case_		:			Optional[int]											=	hidden_act
							snake_case_		:			Any											=	initializer_range
							snake_case_		:			Dict											=	rms_norm_eps
							snake_case_		:			List[str]											=	pretraining_tp
							snake_case_		:			Any											=	use_cache
							snake_case_		:			Optional[Any]											=	rope_scaling
							self._rope_scaling_validation()

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






						def UpperCAmelCase_				(      self      :      Optional[Any]	)							->    Optional[int]:







							"""simple docstring"""


							if self.rope_scaling is None:
								return

							if not isinstance(self.rope_scaling		,   _A	) 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}"""	)
							snake_case_		:			Optional[int]											=	self.rope_scaling.get('type'		,   _A	)
							snake_case_		:			Optional[Any]											=	self.rope_scaling.get('factor'		,   _A	)
							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(_A		,   _A	) 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)

