The error points to:
torch.jit.frontend.UnsupportedNodeError: GeneratorExp aren’t supported

which is raised due to the used generator expression as seen in this minimal code snippet:
class MyModel(nn.Module):
    def __init__(self):
        super().__init__()
        
    def forward(self, x):
        a = any(i for i in range(10))
        return x


model = MyModel()
x = torch.randn(1, 1)
out = model(x)

scripted = torch.jit.script(model)
# > UnsupportedNodeError: GeneratorExp aren't supported