A compound of Formula I: or a pharmaceutically acceptable salt thereof, wherein X is N or CR 6; R 1 is hydrogen, C1-C4 alkyl, C1-C4 fluoroalkyl, or halo; R 2 is halo or cyano; R 3 is hydrogen, C1-C4 alkyl, halo, cyano, C1-C4 fluoroalkyl, -(C1-C4 alkyl)OH, or -NR a R b, wherein R a or R b is independently hydrogen, C3-C6 cycloalkyl, heterocycloalkyl or C1-C4 alkyl, or R a /R b and the nitrogen atom they are attached to form a 5 or 6-membered ring optionally independently substituted by one or more substituents selected from halo, C1-C4 alkyl, cyano, hydroxy and -O(C1-C4 alkyl); R 4 is hydrogen, C1-C6 alkyl, C1-C10heteroalkyl, C1-C4 fluoroalkyl, -(C1-C4 alkyl)NH 2, C3-C6 cycloalkyl, -(C1-C4 alkyl)(C3-C6 cycloalkyl), -(C1-C4 alkyl)phenyl, phenyl, heteroaryl, -(C1-C4 alkyl)heteroaryl, C2-C5 alkenyl, -(C1-C4 alkyl)heterocycloalkyl, heterocycloalkyl, -C0-C4 alkylS(=O) 2 (C1-C4 alkyl), -S(=O) 2 phenyl, -S(=O) 2 heteroaryl, -C0-C4 alkylC(=O)heterocycloalkyl, -C0-C4 alkyl C(=O)NR a R b, -(C0-C4 alkyl)C(=O)O(C1-C4 alkyl), -(C0-C4 alkyl)C(=O)C1-C4 alkyl, -(C0-C4 alkyl)C(=O)OH or -(C1-C8 alkyl)OH, wherein R 4 is substituted with 0, 1, 2, or 3 substituents selected from deuterium, halo, hydroxy, -(C0-C4alkyl)O(C1-C4 alkyl), -C1-C4 alkyl, -(C0-C4alkyl)cyano, -S(=O) 2 (C1-C4 alkyl), - C0-C4 alkylC(=O)NR a R b, -C(=O)O(C1-C4 alkyl), C1-C4 fluoroalkyl oxo, -(C1-C4 alkyl)OH, and -NH 2, wherein each of R a and R b is independently substituted with 0, 1, 2, or 3 hydrogen, C3-C6 cycloalkyl, heterocycloalkyl or C1-C4 alkyl; R 5 is hydrogen, halo, -NH 2 or C1-C4 alkyl; R 6 is hydrogen, halo or C1-C4 alkyl; and R 7 is hydrogen, halo, heteroalkyl, C1-C4 alkyl, -(C0-C4 alkyl)O( C1-C4 alkyl), -(C1-C4 alkyl)(C3-C6 cycloalkyl), C3-C6 cycloalkyl, -(C1-C4 alkyl)heterocycloalkyl, or heterocycloalkyl. or a pharmaceutically acceptable salt thereof, wherein X is N or CR 6; R 1 is hydrogen, C1-C4 alkyl, C1-C4 fluoroalkyl, or halo; R 2 is halo or cyano; R 3 is hydrogen, C1-C4 alkyl, halo, cyano, C1-C4 fluoroalkyl, -(C1-C4 alkyl)OH, or -NR a R b, wherein R a or R b is independently hydrogen, C3-C6 cycloalkyl, heterocycloalkyl or C1-C4 alkyl, or R a /R b and the nitrogen atom they are attached to form a 5 or 6-membered ring optionally independently substituted by one or more substituents selected from halo, C1-C4 alkyl, cyano, hydroxy and -O(C1-C4 alkyl); R 4 is hydrogen, C1-C6 alkyl, C1-C10heteroalkyl, C1-C4 fluoroalkyl, -(C1-C4 alkyl)NH 2, C3-C6 cycloalkyl, -(C1-C4 alkyl)(C3-C6 cycloalkyl), -(C1-C4 alkyl)phenyl, phenyl, heteroaryl, -(C1-C4 alkyl)heteroaryl, C2-C5 alkenyl, -(C1-C4 alkyl)heterocycloalkyl, heterocycloalkyl, -C0-C4 alkylS(=O) 2 (C1-C4 alkyl), -S(=O) 2 phenyl, -S(=O) 2 heteroaryl, -C0-C4 alkylC(=O)heterocycloalkyl, -C0-C4 alkyl C(=O)NR a R b, -(C0-C4 alkyl)C(=O)O(C1-C4 alkyl), -(C0-C4 alkyl)C(=O)C1-C4 alkyl, -(C0-C4 alkyl)C(=O)OH or -(C1-C8 alkyl)OH, wherein R 4 is substituted with 0, 1, 2, or 3 substituents selected from deuterium, halo, hydroxy, -(C0-C4alkyl)O(C1-C4 alkyl), -C1-C4 alkyl, -(C0-C4alkyl)cyano, -S(=O) 2 (C1-C4 alkyl), - C0-C4 alkylC(=O)NR a R b, -C(=O)O(C1-C4 alkyl), C1-C4 fluoroalkyl oxo, -(C1-C4 alkyl)OH, and -NH 2, wherein each of R a and R b is independently substituted with 0, 1, 2, or 3 hydrogen, C3-C6 cycloalkyl, heterocycloalkyl or C1-C4 alkyl; R 5 is hydrogen, halo, -NH 2 or C1-C4 alkyl; R 6 is hydrogen, halo or C1-C4 alkyl; and R 7 is hydrogen, halo, heteroalkyl, C1-C4 alkyl, -(C0-C4 alkyl)O( C1-C4 alkyl), -(C1-C4 alkyl)(C3-C6 cycloalkyl), C3-C6 cycloalkyl, -(C1-C4 alkyl)heterocycloalkyl, or heterocycloalkyl.