loading t5 model from a local file #345
MittalNeha
started this conversation in
General
Replies: 1 comment
-
Modify t5.py, or pass in a model name which points to a local model. I had to hack a number of files I believe to make it work easily with a pre-cached .model. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the current implementation, the t5 model is downloaded from huggingface and saved somewhere is cache. I would like to use the downloaded T5 model instead of relying on HuggingFace.
Looking for some guidance on the same.
This is the function where the model download is being initiated.
def get_encoded_dim(name):
if name not in T5_CONFIGS:
# avoids loading the model if we only want to get the dim
config = T5Config.from_pretrained(name)
T5_CONFIGS[name] = dict(config=config)
elif "config" in T5_CONFIGS[name]:
config = T5_CONFIGS[name]["config"]
elif "model" in T5_CONFIGS[name]:
config = T5_CONFIGS[name]["model"].config
else:
assert False
return config.d_model
Thanks
Beta Was this translation helpful? Give feedback.
All reactions