GLINT-CT / text_encoders.py
seongeun-lee's picture
Release GLINT-CT
c5a246d
Raw History Blame Contribute Delete
339 Bytes
from transformers import MPNetConfig, MPNetModel
def build_text_encoder(config):
if config.model_type == "mpnet":
fields = config.to_dict()
fields.pop("model_type", None)
return MPNetModel(MPNetConfig(**fields))
else:
raise NotImplementedError(f"Unsupported text model_type: {config.model_type}")