该模型是 google/t5-efficient-tiny 在 billsum 数据集上的微调版本。 其在评估集上取得了以下结果:
训练过程中使用了以下超参数:
| 训练损失 | 轮次 | 步数 | 验证损失 | Rouge1 | Rouge2 | Rougel | Rougelsum | 生成长度 |
|---|---|---|---|---|---|---|---|---|
| 无日志 | 1.0 | 62 | 4.2835 | 0.1413 | 0.0323 | 0.1125 | 0.1124 | 19.0 |
| 无日志 | 2.0 | 124 | 3.7275 | 0.1507 | 0.0408 | 0.1263 | 0.1264 | 19.0 |
| 无日志 | 3.0 | 186 | 3.6154 | 0.1499 | 0.0407 | 0.1244 | 0.1244 | 19.0 |
| 无日志 | 4.0 | 248 | 3.5889 | 0.1503 | 0.0412 | 0.1244 | 0.1244 | 19.0 |
import argparse
import torch
from openmind import pipeline, is_torch_npu_available
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--model_name_or_path", type=str, help="Path to model", default=None)
args = parser.parse_args()
return args
if __name__ == '__main__':
args = parse_args()
if is_torch_npu_available():
device = "npu:0"
else:
device = "cpu"
print("device",device)
model_path = args.model_name_or_path
print("Model path is:", model_path)
try:
generator = pipeline('text-generation', model=model_path, device=device)
print("Generator initialized successfully")
except Exception as e:
print(f"Error initializing generator: {e}")
try:
output = generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5, num_beams=5, truncation=True)
print("Run successful. Generated outputs:")
for idx, sequence in enumerate(output):
print(f"Generated sequence {idx + 1}: {sequence['generated_text']}")
except Exception as e:
print(f"Error during generation: {e}")