tensorflow

Tensorflow utilities. Adapted from https://github.com/rasbt/LLMs-from-scratch.

mfai.tensorflow.download_and_load_gpt2(model_size, models_dir)[source]

Downloads GPT2 official weights from openai with a fallback to the LLMs-from-scratch repository.

Return type:

tuple[dict, dict]

Parameters:
mfai.tensorflow.load_weights_from_tf_checkpoint(ckpt_path, settings)[source]

Loads a tensorflow checkpoint into a dict. Used to transfer weights from tensorflow to pytorch implementations of same models.

Return type:

dict

Parameters: