import evaluate perplexity = evaluate.load("../metrics/perplexity") input_texts = ["你好!", "打死哦对吉萨大你去我家而且我就", "这辆车非常优秀"] results = perplexity.compute(model_id='gpt2', add_start_token=False, predictions=input_texts) print(list(results.keys())) print(results["perplexities"])