Deduction from the context, i.e., this is a passage that occurs in the chapters describing his Galilean ministry; and from the fact that Mary was already aware of his supernatural nature in Luke 1 and John 2.
Mary never requested a miracle from Him at the wedding of Cana.
She simply notified Him that they ran out of wine and told the servants to do whatever He told them.
Why would she bother telling him if she didn't know He could solve the problem, and why would He regard her comment as involving him if no request was implied?
You really want somebody to tell you?
How about searching the matter out for yourself?
Try studying up on what wine signified among that era's Jewry specifically in context of wedding celebrations which often could go on for days.