Views
No views yet
| Bullet | Translation to Sentence |
|---|---|
| - Maintained 112 acft G-files; conducted 100% insp of T.Os job guides--efforts key to flt's 96% LSEP pass rate | I maintained 112 aircraft G-files and conducted 100% inspection of T.O job guides, contributing to the flight's 96% LSEP pass rate. |
| - Spearheaded mx for 43 nuke-cert vehs$5.2M; achieved peak 99% MC rt--vital to SECAF #1 priorit ynuc deterrence | I spearheaded the maintenance for 43 nuclear-certified vehicles worth $5.2 million, achieving a peak 99% mission capability rating. This mission was vital to the SECAF's #1 priority of nuclear deterrence. |
| - Superb NCO; mng'd mobility ofc during LibyanISAF ops; continuously outshines peers--promote to MSgt now | I am a superb Non-Commissioned Officer (NCO) who managed the mobility operation during Libyan ISAF operations. I continuously outshines my peers and deserve a promotion to MSgt now. |
| - Managed PMEL prgrm; maintained 300+ essential equipment calibration items--reaped 100% TMDE pass rt | I managed the PMEL program and maintained over 300+ essential equipment calibration items, resulting in a 100% Test, Measurement, and Diagnostic Equipment (TMDE) pass rate. |
@article{lamini-lm,
author = {Minghao Wu and
Abdul Waheed and
Chiyu Zhang and
Muhammad Abdul-Mageed and
Alham Fikri Aji
},
title = {LaMini-LM: A Diverse Herd of Distilled Models from Large-Scale Instructions},
journal = {CoRR},
volume = {abs/2304.14402},
year = {2023},
url = {https://arxiv.org/abs/2304.14402},
eprinttype = {arXiv},
eprint = {2304.14402}
}1import torch
2from transformers import T5ForConditionalGeneration, T5Tokenizer
3
4bullet_data_creation_prefix = "Using full sentences, expand upon the following Air and Space Force bullet statement by spelling-out acronyms and adding additional context: "
5
6# Path of the pre-trained model that will be used
7model_path = "justinthelaw/opera-bullet-interpreter"
8# Path of the pre-trained model tokenizer that will be used
9# Must match the model checkpoint's signature
10tokenizer_path = "justinthelaw/opera-bullet-interpreter"
11# Max length of tokens a user may enter for summarization
12# Increasing this beyond 512 may increase compute time significantly
13max_input_token_length = 512
14# Max length of tokens the model should output for the summary
15# Approximately the number of tokens it may take to generate a bullet
16max_output_token_length = 512
17# Beams to use for beam search algorithm
18# Increased beams means increased quality, but increased compute time
19number_of_beams = 6
20# Scales logits before soft-max to control randomness
21# Lower values (~0) make output more deterministic
22temperature = 0.5
23# Limits generated tokens to top K probabilities
24# Reduces chances of rare word predictions
25top_k = 50
26# Applies nucleus sampling, limiting token selection to a cumulative probability
27# Creates a balance between randomness and determinism
28top_p = 0.90
29
30try:
31 tokenizer = T5Tokenizer.from_pretrained(
32 f"{model_path}",
33 model_max_length=max_input_token_length,
34 add_special_tokens=False,
35 )
36 input_model = T5ForConditionalGeneration.from_pretrained(f"{model_path}")
37 logger.info(f"Loading {model_path}...")
38 # Set device to be used based on GPU availability
39 device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
40 # Model is sent to device for use
41 model = input_model.to(device) # type: ignore
42
43 input_text = bullet_data_creation_prefix + input("Input a US Air or Space Force bullet: ")
44
45 encoded_input_text = tokenizer.encode_plus(
46 input_text,
47 return_tensors="pt",
48 truncation=True,
49 max_length=max_input_token_length,
50 )
51
52 # Generate summary
53 summary_ids = model.generate(
54 encoded_input_text["input_ids"],
55 attention_mask=encoded_input_text["attention_mask"],
56 max_length=max_output_token_length,
57 num_beams=number_of_beams,
58 temperature=temperature,
59 top_k=top_k,
60 top_p=top_p,
61 early_stopping=True,
62 )
63
64 output_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
65
66 print(f"Your input: {input_line["output"]}")
67 print(f"The model's output: {output_text}")
68
69except KeyboardInterrupt:
70 print("Received interrupt, stopping script...")
71except Exception as e:
72 print(f"An error occurred during generation: {e}")