




"""simple docstring"""
from typing import Union

import fire
import torch
from tqdm import tqdm





def 						UpperCAmelCase				(			A__:    Optional[Any]							,				A__:    Any = "cpu"							,				A__:    Any = None     )  ->     str:
			__lowerCamelCase					:	Tuple	       =				torch.load(_UpperCAmelCase							,				map_location=_UpperCAmelCase     )
			for k, v in tqdm(state_dict.items()     ):
						if not isinstance(_UpperCAmelCase							,				torch.Tensor     ):
									raise TypeError('FP16 conversion only works on paths that are saved state dicts, like pytorch_model.bin'     )
						__lowerCamelCase					:	int	       =				v.half()
			if save_path is None:  # overwrite src_path
						__lowerCamelCase					:	List[str]	       =				src_path
			torch.save(_UpperCAmelCase							,				_UpperCAmelCase     )


if __name__ == "__main__":
	fire.Fire(convert)









"""simple docstring"""
import requests

a_				:    Optional[Any]										=     ''''''  # <-- Put your OpenWeatherMap appid here!
a_				:    str										=     '''https://api.openweathermap.org/data/2.5/'''





def 						UpperCAmelCase				(			A__:    str = "Chicago"							,				A__:    str = APPID     )  ->     dict:
			return requests.get(URL_BASE + 'weather'							,				params=locals()     ).json()





def 						UpperCAmelCase				(			A__:    str = "Kolkata, India"							,				A__:    str = APPID     )  ->     dict:
			return requests.get(URL_BASE + 'forecast'							,				params=locals()     ).json()





def 						UpperCAmelCase				(			A__:    float = 55.68							,				A__:    float = 12.57							,				A__:    str = APPID     )  ->     dict:
			return requests.get(URL_BASE + 'onecall'							,				params=locals()     ).json()


if __name__ == "__main__":
					from pprint import pprint

					while True:
										a_				:    List[Any]										=     input('''Enter a location:''').strip()
										if location:
															pprint(current_weather(location))
										else:
															break



