This model specializes in analyzing industrial sensor data and network telemetry to detect anomalies, identify potential security threats, and provide actionable insights for industrial automation systems.
1 from transformers import AutoModelForCausalLM , AutoTokenizer
2 import torch
3
4 # Load model and tokenizer
5 model = AutoModelForCausalLM . from_pretrained (
6 "YOUR_USERNAME/phi3-industrial-anomaly" ,
7 torch_dtype = torch . bfloat16 ,
8 device_map = "auto" ,
9 trust_remote_code = True
10 )
11 tokenizer = AutoTokenizer . from_pretrained (
12 "YOUR_USERNAME/phi3-industrial-anomaly" ,
13 trust_remote_code = True
14 )
15
16 # Prepare input
17 prompt = """<|user|>
18 Sensor Readings: Temperature: 95°C, Vibration: 5.8 m/s, Pressure: 120 kPa, Flow Rate: 6.2 L/min
19 <|end|>
20 <|assistant|>"""
21
22 inputs = tokenizer ( prompt , return_tensors = "pt" ) . to ( model . device )
23
24 # Generate response
25 outputs = model . generate (
26 ** inputs ,
27 max_new_tokens = 150 ,
28 temperature = 0.7 ,
29 do_sample = True ,
30 pad_token_id = tokenizer . eos_token_id
31 )
32
33 response = tokenizer . decode ( outputs [ 0 ] , skip_special_tokens = True )
34 print ( response )
1 from peft import AutoPeftModelForCausalLM
2 from transformers import AutoTokenizer
3 import torch
4
5 # Load model with LoRA adapters
6 model = AutoPeftModelForCausalLM . from_pretrained (
7 "YOUR_USERNAME/phi3-industrial-anomaly" ,
8 torch_dtype = torch . bfloat16 ,
9 device_map = "auto" ,
10 trust_remote_code = True
11 )
12 tokenizer = AutoTokenizer . from_pretrained (
13 "YOUR_USERNAME/phi3-industrial-anomaly" ,
14 trust_remote_code = True
15 )
<|user|>
Network Telemetry: Arp.Opcode: 0.0, Icmp.Checksum: 0.0, Suspicious packet patterns detected
<|end|>
<|assistant|>
<|user|>
Sensor Readings: Temperature: 110°C, Vibration: 7.2 m/s, Pressure: 85 kPa, Flow Rate: 3.1 L/min
<|end|>
<|assistant|>
1 @misc{phi3-industrial-anomaly-2026,
2 author = {Your Name},
3 title = {Phi-3 Mini Fine-tuned for Industrial Anomaly Detection},
4 year = {2026},
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/YOUR_USERNAME/phi3-industrial-anomaly}}
7 }
This model is released under the MIT License. The base Phi-3 model is subject to Microsoft's
Phi-3 license .
For questions, issues, or collaboration opportunities, please open an issue in the repository or contact the model author.