wandb.init(reinit=True)
and run.finish()
helped me to log the models separately on wandb website.
The working code looks like below:
for file in os.listdir(args.data_dir):
finetune(args, file)
import wandb
def finetune(args, file):
run = wandb.init(reinit=True)
...
run.finish()
Reference: Launch Experiments with wandb.init - Documentation