Spaces:
Runtime error
Runtime error
Update
Browse files81 unmodified lines82838485868788899091929381 unmodified linesvalue=0.7,label='Truncation psi')truncation_type = gr.Dropdown(['Multimodal (LPIPS)','Multimodal (L2)','Global',],value='Multimodal (LPIPS)',label='Truncation Type')run_button = gr.Button('Run')with gr.Column():81 unmodified lines828384858687888981 unmodified linesvalue=0.7,label='Truncation psi')truncation_type = gr.Dropdown(model.TRUNCATION_TYPES,value=model.TRUNCATION_TYPES[0],label='Truncation Type')run_button = gr.Button('Run')with gr.Column():
53 unmodified lines545556575859133 unmodified lines19319419519619719819920020120220320453 unmodified lines'giraffes_512','parrots_512',]def __init__(self, device: str | torch.device):self.device = torch.device(device)133 unmodified linestruncation_type: str) -> np.ndarray:z = self.generate_z(seed)ws = self.compute_w(z)if truncation_type == 'Global':w0 = self.model.mapping.w_avgelse:if truncation_type == 'Multimodal (LPIPS)':distance_type = 'lpips'elif truncation_type == 'Multimodal (L2)':distance_type = 'l2'else:raise ValueError53 unmodified lines5455565758596061626364133 unmodified lines19819920020120220320420520620720820953 unmodified lines'giraffes_512','parrots_512',]TRUNCATION_TYPES = ['Multimodal (LPIPS)','Multimodal (L2)','Global',]def __init__(self, device: str | torch.device):self.device = torch.device(device)133 unmodified linestruncation_type: str) -> np.ndarray:z = self.generate_z(seed)ws = self.compute_w(z)if truncation_type == self.TRUNCATION_TYPES[2]:w0 = self.model.mapping.w_avgelse:if truncation_type == self.TRUNCATION_TYPES[0]:distance_type = 'lpips'elif truncation_type == self.TRUNCATION_TYPES[1]:distance_type = 'l2'else:raise ValueError
app.py+2-6
model.py+8-3