from modeling_autoencoder import AutoEncoderConfig, AutoEncoder | |
from transformers import PretrainedConfig, PreTrainedModel, AutoConfig, AutoModel | |
AutoEncoderConfig.register_for_auto_class() | |
AutoEncoder.register_for_auto_class("AutoModel") | |
AutoConfig.register("autoencoder", AutoEncoderConfig) | |
AutoModel.register(AutoEncoderConfig, AutoModel) | |
AutoEncoder(AutoEncoderConfig()).push_to_hub("autoencoder") | |
# config = AutoConfig.from_pretrained("amaye15/autoencoder", trust_remote_code = True) | |
# autoencoder = AutoModel.from_config(config, trust_remote_code = True) | |