sainikhiljuluri commited on
Commit
518ff09
·
verified ·
1 Parent(s): de30706

Update README with inference config

Browse files
Files changed (1) hide show
  1. README.md +22 -18
README.md CHANGED
@@ -14,6 +14,7 @@ datasets:
14
  language:
15
  - en
16
  pipeline_tag: text-generation
 
17
  inference: true
18
  ---
19
 
@@ -40,44 +41,47 @@ This merged model can be loaded directly without needing PEFT.
40
 
41
  ## Usage
42
 
 
43
  ```python
44
  from transformers import AutoModelForCausalLM, AutoTokenizer
45
  import torch
46
 
47
- # Load merged model directly (no PEFT needed!)
48
  model = AutoModelForCausalLM.from_pretrained(
49
  "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
50
  torch_dtype=torch.bfloat16,
51
- device_map="auto"
 
 
 
 
 
52
  )
53
- tokenizer = AutoTokenizer.from_pretrained("sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged")
54
 
55
- # Generate
56
- prompt = "Explain how to detect SQL injection attacks in web server logs."
57
  inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
58
  outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
59
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
60
  ```
61
 
62
- ## Inference API
63
-
64
- This model is deployed on HuggingFace Inference Endpoints.
65
-
66
  ```python
67
- from huggingface_hub import InferenceClient
68
 
69
- client = InferenceClient("sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged")
70
- response = client.text_generation(
71
- "What are the indicators of a ransomware attack?",
72
- max_new_tokens=256
73
- )
74
- print(response)
 
 
75
  ```
76
 
77
- ## Cybersecurity Tasks
78
 
79
  - 🔍 Threat analysis and classification
80
- - 🚨 Security alert triage
81
  - 📋 Incident response guidance
82
  - 🦠 Malware analysis
83
  - 📊 MITRE ATT&CK mapping
 
 
14
  language:
15
  - en
16
  pipeline_tag: text-generation
17
+ library_name: transformers
18
  inference: true
19
  ---
20
 
 
41
 
42
  ## Usage
43
 
44
+ ### Direct Loading
45
  ```python
46
  from transformers import AutoModelForCausalLM, AutoTokenizer
47
  import torch
48
 
 
49
  model = AutoModelForCausalLM.from_pretrained(
50
  "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
51
  torch_dtype=torch.bfloat16,
52
+ device_map="auto",
53
+ trust_remote_code=True
54
+ )
55
+ tokenizer = AutoTokenizer.from_pretrained(
56
+ "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
57
+ trust_remote_code=True
58
  )
 
59
 
60
+ prompt = "Explain how to detect SQL injection attacks."
 
61
  inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
62
  outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
63
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
64
  ```
65
 
66
+ ### Via Inference API
 
 
 
67
  ```python
68
+ import requests
69
 
70
+ API_URL = "https://api-inference.huggingface.co/models/sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged"
71
+ headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
72
+
73
+ response = requests.post(API_URL, headers=headers, json={
74
+ "inputs": "What are the indicators of a ransomware attack?",
75
+ "parameters": {"max_new_tokens": 256, "temperature": 0.7}
76
+ })
77
+ print(response.json())
78
  ```
79
 
80
+ ## Cybersecurity Capabilities
81
 
82
  - 🔍 Threat analysis and classification
83
+ - 🚨 Security alert triage
84
  - 📋 Incident response guidance
85
  - 🦠 Malware analysis
86
  - 📊 MITRE ATT&CK mapping
87
+ - 🔐 Vulnerability assessment