Sure, but a few explanations first:
nn.Module: very practical for learnable layers (will handle backward pass automatically once you define the forward() method), but it needs to __init__ first, and then will be called in the forward(x) method with some input tensor x.
nn.functional: shortcut functions for simple layers mostly, particularly those without learnable layers (pooling, activation functions, and so on), which you can call directly on the input tensor x.
In your case, your code uses the nn.Module approach, which is to define the layers first (here 7 in your code) and then use it later (here 5 in your code).
What you need to change, if you want to remove the first UserWarning that you got, is to remove lines 104-109 14 completely, since they are useless in the nn.functional approach (I’m assuming that the comments on lines 104-105 are part of this layer, despite the indentation).
Then, modify lines 174-175 11 as follows:
if module_type == "convolutional":
    x = self.module_list[i](x)
elif module_type == "upsample":
    x = nn.functional.interpolate(x, scale_factor=2, mode="nearest")