Automatically Inhibit sleep while transferring files over the network?
You can install 3rd part app Caffeine. you can turn it on to prevent your mac from sleeping. Other popular apps are Anti Sleep and Amphetamine. I'm pretty sure all 3 are free. Amphetamine is also available from the App Store. I personally use Caffeine and it works well. It adds a coffee cup icon to menu bar so you can easily turn it on or off.

Caffeine may actually come with newer system upgrades so check your Applications folder.