This model is a fine-tuned version of google/t5-efficient-tiny on the billsum dataset. It achieves the following results on the evaluation set:
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Rouge1 | Rouge2 | Rougel | Rougelsum | Gen Len |
|---|---|---|---|---|---|---|---|---|
| No log | 1.0 | 62 | 4.2835 | 0.1413 | 0.0323 | 0.1125 | 0.1124 | 19.0 |
| No log | 2.0 | 124 | 3.7275 | 0.1507 | 0.0408 | 0.1263 | 0.1264 | 19.0 |
| No log | 3.0 | 186 | 3.6154 | 0.1499 | 0.0407 | 0.1244 | 0.1244 | 19.0 |
| No log | 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}")