It can be either, depending on the context. Usually it is clear. If you can create a relative clause from the non-finite verb and preserve the meaning, then it acts as a modifier.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.