Trainer class and compute_metrics

I am doing summarization tasks and when I am looking through the example of summarizationlink. In compute_metrics function. The tokenizer is defined in the same namespace before. But if I want to another scripts to store compute_metrics function. How do I modify the function when it comes to tokenizer, since I pass it to Trainer. I just do not like everything in the main function.