

def        lowerCamelCase__       (    _a):
	assert (
	    isinstance(lowerCAmelCase_							,	lowerCAmelCase_) and number_of_steps > 0
	), f"number_of_steps needs to be positive integer, your input {number_of_steps}"
	if number_of_steps == 1:
		return 1
	SCREAMING_SNAKE_CASE      :					str    =				1, 1
	for _ in range(number_of_steps - 1):
		SCREAMING_SNAKE_CASE      :					Union[str, Any]    =				current + previous, current
	return current


if __name__ == "__main__":
			import doctest

			doctest.testmod()



from typing import Union

import fire
import torch
from tqdm import tqdm



def 	lowerCAmelCase       (						lowerCAmelCase_       ,      lowerCAmelCase_ = "cpu"       ,      lowerCAmelCase_ = None       )->       None:
				lowerCAmelCase_       :					str			 = torch.load(lowerCAmelCase_       ,      map_location=lowerCAmelCase_       )
				for k, v in tqdm(state_dict.items()       ):
								if not isinstance(lowerCAmelCase_       ,      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_       :					Tuple			 = src_path
				torch.save(lowerCAmelCase_       ,      lowerCAmelCase_       )


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