in video_processing/modules/aesthetic_laion.py [0:0]
def __init__(self, dtype, path):
super().__init__()
self.clip = CLIPVisionModelWithProjection.from_pretrained("openai/clip-vit-large-patch14")
self.processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
self.mlp = MLP()
if path is None:
path = hf_hub_download("trl-lib/ddpo-aesthetic-predictor", "aesthetic-model.pth")
state_dict = torch.load(path, weights_only=True, map_location=torch.device("cpu"))
self.mlp.load_state_dict(state_dict)
self.dtype = dtype
self.eval()