AttributeError: module 'config' has no attribute 'model_path'

Although I have assigned a model path in the config.py file, I’m getting the following error.

if mode == "test":
    # Test data address
    lr_dir = f"./data/"
    sr_dir = f"./results/"
    hr_dir = f"./data/"

    model_path = "./results/baseline/g_best.pth.tar

Traceback (most recent call last):
File “./test.py”, line 111, in
main()
File “./test.py”, line 33, in main
checkpoint = torch.load(config.model_path, map_location=lambda storage, loc: storage)
AttributeError: module ‘config’ has no attribute 'model_path’

Pytorch version: 1.10.2
Python: 3.6.13
Please help me in this regard.