Views
No views yet

1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "yasserrmd/ConstructionSafetyQA-1.2B-V1"
4
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 device_map="auto",
9)
10
11messages = [
12 {"role": "system", "content": "You are a construction safety trainer. Always give short, practical, safety-first answers."},
13 {"role": "user", "content": "What should workers do if scaffolding guardrails are missing?"}
14]
15
16inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
17outputs = model.generate(inputs, max_new_tokens=128)
18print(tokenizer.decode(outputs[0], skip_special_tokens=True))What should workers do if scaffolding guardrails are missing?Workers must stop using the scaffold and report it. Guardrails must be installed before work continues.Why is hydration important when working in hot weather?Hydration prevents heat exhaustion and keeps workers alert and safe.1@misc{yasser2025constructionsafetyqa,
2 title={ConstructionSafetyQA-1.2B-V1},
3 author={Mohamed Yasser},
4 year={2025},
5 publisher={Hugging Face},
6 howpublished={\url{https://huggingface.co/yasserrmd/ConstructionSafetyQA-1.2B-V1}}
7}