With a low-end GPU like that the i5 and the i7 are going to perform pretty much the same.
I would consider i5 7300HQ with 1050 ti or 1060 if possible.
But if only those two options fit your budget, that's a though question there's not a clear winner. In some cases the i7 7700HQ is going to help a little bit more and in some games the 4GB 1050 is going to be the best choice.
For instance, let's say you are running a very CPU-intensive game such as Civilization VI, then the i7 is best suited for that particular game.
But now let's say you want to run Tomb Raider which is not a particularly CPU-intensive game but it requires a ton of VRAM if you want to run ultra textures and stuff.
Both CPU and video memory are going to be a limiting factor someday. So I would look at other differences not only CPU and GPU to see which is the best opcion