import evaluate
'''
离线使用evaluate: 1. 下载evaluate 文件:https://github.com/huggingface/evaluate/tree/main
2. 离线使用 路径+/evaluate-main/metrics/rouge
'''
rouge=evaluate.load("/app/tensorrt_llm/examples/qwen2/evaluate-main/metrics/rouge")
predictions =["Transformers Transformers are fast plus efficient",
"Good Morning", "I am waiting for new Transformers"]
references =[["HuggingFace Transformers are fast efficient plus awesome",
"Transformers are awesome because they are fast to execute"],
["Good Morning Transformers", "Morning Transformers"],
["People are eagerly waiting for new Transformer models",
"People are very excited about new Transformers"]
results = rouge.compute(predictions=predictions, references=references)
print(results)