This model is a fine-tuned version of t5-base on the cuad dataset. It achieves the following results on the evaluation set:
from openmind import pipeline
from openmind import is_torch_npu_available
import torch
import argparse
import torch.nn.functional as F
import time
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--model_name_or_path",
type=str,
help="Path to model",
default="zhouhui/T5-base-finetuned-cuad",
)
args = parser.parse_args()
return args
def main():
args = parse_args()
model_path = args.model_name_or_path
if is_torch_npu_available():
device = "npu:0"
else:
device = "cpu"
#device = "cpu"
start_time = time.time()
generator = pipeline('text2text-generation', model= model_path , device=device,trust_remote_code=True)
output = generator("They were there to enjoy us and they were there to pray for us.", do_sample=True, min_length=50)
print(f">>>output={output}")
end_time = time.time()
print(f"硬件环境:{device},推理执行时间:{end_time - start_time}秒")
if __name__ == "__main__":
main()More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.2809 | 1.0 | 2795 | 0.2331 |
| 0.2459 | 2.0 | 5590 | 0.2253 |
| 0.2355 | 3.0 | 8385 | 0.2220 |
| 0.2212 | 4.0 | 11180 | 0.2203 |
| 0.2068 | 5.0 | 13975 | 0.2197 |
| 0.2085 | 6.0 | 16770 | 0.2194 |
| 0.1968 | 7.0 | 19565 | 0.2199 |
| 0.1906 | 8.0 | 22360 | 0.2200 |
| 0.1909 | 9.0 | 25155 | 0.2208 |
| 0.1788 | 10.0 | 27950 | 0.2209 |