lliu01 commited on
Commit
7c3883d
·
verified ·
1 Parent(s): a626d07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -185
app.py CHANGED
@@ -67,195 +67,13 @@ def predict(message, history, system_prompt, temperature, max_tokens):
67
  ["What are services in FortiOS and how are they used in firewall policies?"],
68
  ],
69
  """
70
- sys_prompt = """FortiOS firewall configuration in CLI.\n
71
- Use the firewall config template below to refine your answer, make sure the attributes in the config belongs to the template.\n
72
- config firewall policy
73
- edit <policyid>
74
- set action [accept|deny|ipsec]
75
- set anti-replay [enable|disable]
76
- set application-list {string}
77
- set auth-cert {string}
78
- set auth-path [enable|disable]
79
- set auth-redirect-addr {string}
80
- set auto-asic-offload [enable|disable]
81
- set av-profile {string}
82
- set block-notification [enable|disable]
83
- set captive-portal-exempt [enable|disable]
84
- set capture-packet [enable|disable]
85
- set casb-profile {string}
86
- set cifs-profile {string}
87
- set comments {var-string}
88
- set custom-log-fields <field-id1>, <field-id2>, ...
89
- set decrypted-traffic-mirror {string}
90
- set delay-tcp-npu-session [enable|disable]
91
- set diameter-filter-profile {string}
92
- set diffserv-copy [enable|disable]
93
- set diffserv-forward [enable|disable]
94
- set diffserv-reverse [enable|disable]
95
- set diffservcode-forward {user}
96
- set diffservcode-rev {user}
97
- set disclaimer [enable|disable]
98
- set dlp-profile {string}
99
- set dnsfilter-profile {string}
100
- set dsri [enable|disable]
101
- set dstaddr <name1>, <name2>, ...
102
- set dstaddr-negate [enable|disable]
103
- set dstaddr6 <name1>, <name2>, ...
104
- set dstaddr6-negate [enable|disable]
105
- set dstintf <name1>, <name2>, ...
106
- set dynamic-shaping [enable|disable]
107
- set email-collect [enable|disable]
108
- set emailfilter-profile {string}
109
- set fec [enable|disable]
110
- set file-filter-profile {string}
111
- set firewall-session-dirty [check-all|check-new]
112
- set fixedport [enable|disable]
113
- set fsso-agent-for-ntlm {string}
114
- set fsso-groups <name1>, <name2>, ...
115
- set geoip-anycast [enable|disable]
116
- set geoip-match [physical-location|registered-location]
117
- set groups <name1>, <name2>, ...
118
- set http-policy-redirect [enable|disable]
119
- set icap-profile {string}
120
- set identity-based-route {string}
121
- set inbound [enable|disable]
122
- set inspection-mode [proxy|flow]
123
- set internet-service [enable|disable]
124
- set internet-service-custom <name1>, <name2>, ...
125
- set internet-service-custom-group <name1>, <name2>, ...
126
- set internet-service-group <name1>, <name2>, ...
127
- set internet-service-name <name1>, <name2>, ...
128
- set internet-service-negate [enable|disable]
129
- set internet-service-src [enable|disable]
130
- set internet-service-src-custom <name1>, <name2>, ...
131
- set internet-service-src-custom-group <name1>, <name2>, ...
132
- set internet-service-src-group <name1>, <name2>, ...
133
- set internet-service-src-name <name1>, <name2>, ...
134
- set internet-service-src-negate [enable|disable]
135
- set internet-service6 [enable|disable]
136
- set internet-service6-custom <name1>, <name2>, ...
137
- set internet-service6-custom-group <name1>, <name2>, ...
138
- set internet-service6-group <name1>, <name2>, ...
139
- set internet-service6-name <name1>, <name2>, ...
140
- set internet-service6-negate [enable|disable]
141
- set internet-service6-src [enable|disable]
142
- set internet-service6-src-custom <name1>, <name2>, ...
143
- set internet-service6-src-custom-group <name1>, <name2>, ...
144
- set internet-service6-src-group <name1>, <name2>, ...
145
- set internet-service6-src-name <name1>, <name2>, ...
146
- set internet-service6-src-negate [enable|disable]
147
- set ippool [enable|disable]
148
- set ips-sensor {string}
149
- set ips-voip-filter {string}
150
- set logtraffic [all|utm|disable]
151
- set logtraffic-start [enable|disable]
152
- set match-vip [enable|disable]
153
- set match-vip-only [enable|disable]
154
- set name {string}
155
- set nat [enable|disable]
156
- set nat46 [enable|disable]
157
- set nat64 [enable|disable]
158
- set natinbound [enable|disable]
159
- set natip {ipv4-classnet}
160
- set natoutbound [enable|disable]
161
- set network-service-dynamic <name1>, <name2>, ...
162
- set network-service-src-dynamic <name1>, <name2>, ...
163
- set np-acceleration [enable|disable]
164
- set ntlm [enable|disable]
165
- set ntlm-enabled-browsers <user-agent-string1>, <user-agent-string2>, ...
166
- set ntlm-guest [enable|disable]
167
- set outbound [enable|disable]
168
- set passive-wan-health-measurement [enable|disable]
169
- set pcp-inbound [enable|disable]
170
- set pcp-outbound [enable|disable]
171
- set pcp-poolname <name1>, <name2>, ...
172
- set per-ip-shaper {string}
173
- set permit-any-host [enable|disable]
174
- set permit-stun-host [enable|disable]
175
- set policy-expiry [enable|disable]
176
- set policy-expiry-date {datetime}
177
- set policy-expiry-date-utc {user}
178
- set poolname <name1>, <name2>, ...
179
- set poolname6 <name1>, <name2>, ...
180
- set port-preserve [enable|disable]
181
- set profile-group {string}
182
- set profile-protocol-options {string}
183
- set profile-type [single|group]
184
- set radius-mac-auth-bypass [enable|disable]
185
- set redirect-url {var-string}
186
- set replacemsg-override-group {string}
187
- set reputation-direction [source|destination]
188
- set reputation-direction6 [source|destination]
189
- set reputation-minimum {integer}
190
- set reputation-minimum6 {integer}
191
- set rtp-addr <name1>, <name2>, ...
192
- set rtp-nat [disable|enable]
193
- set schedule {string}
194
- set schedule-timeout [enable|disable]
195
- set sctp-filter-profile {string}
196
- set send-deny-packet [disable|enable]
197
- set service <name1>, <name2>, ...
198
- set service-negate [enable|disable]
199
- set session-ttl {user}
200
- set sgt <id1>, <id2>, ...
201
- set sgt-check [enable|disable]
202
- set src-vendor-mac <id1>, <id2>, ...
203
- set srcaddr <name1>, <name2>, ...
204
- set srcaddr-negate [enable|disable]
205
- set srcaddr6 <name1>, <name2>, ...
206
- set srcaddr6-negate [enable|disable]
207
- set srcintf <name1>, <name2>, ...
208
- set ssh-filter-profile {string}
209
- set ssh-policy-redirect [enable|disable]
210
- set ssl-ssh-profile {string}
211
- set status [enable|disable]
212
- set tcp-mss-receiver {integer}
213
- set tcp-mss-sender {integer}
214
- set tcp-session-without-syn [all|data-only|disable]
215
- set timeout-send-rst [enable|disable]
216
- set tos {user}
217
- set tos-mask {user}
218
- set tos-negate [enable|disable]
219
- set traffic-shaper {string}
220
- set traffic-shaper-reverse {string}
221
- set users <name1>, <name2>, ...
222
- set utm-status [enable|disable]
223
- set uuid {uuid}
224
- set videofilter-profile {string}
225
- set virtual-patch-profile {string}
226
- set vlan-cos-fwd {integer}
227
- set vlan-cos-rev {integer}
228
- set vlan-filter {user}
229
- set voip-profile {string}
230
- set vpntunnel {string}
231
- set waf-profile {string}
232
- set wanopt [enable|disable]
233
- set wanopt-detection [active|passive|off]
234
- set wanopt-passive-opt [default|transparent|non-transparent]
235
- set wanopt-peer {string}
236
- set wanopt-profile {string}
237
- set wccp [enable|disable]
238
- set webcache [enable|disable]
239
- set webcache-https [disable|enable]
240
- set webfilter-profile {string}
241
- set webproxy-forward-server {string}
242
- set webproxy-profile {string}
243
- set ztna-device-ownership [enable|disable]
244
- set ztna-ems-tag <name1>, <name2>, ...
245
- set ztna-ems-tag-secondary <name1>, <name2>, ...
246
- set ztna-geo-tag <name1>, <name2>, ...
247
- set ztna-policy-redirect [enable|disable]
248
- set ztna-status [enable|disable]
249
- set ztna-tags-match-logic [or|and]
250
- next
251
- end\n
252
- """
253
 
254
  if __name__ == "__main__":
255
  args = parse_args()
256
- tokenizer = AutoTokenizer.from_pretrained("lliu01/fortios_one_config")
257
  model = AutoModelForCausalLM.from_pretrained(
258
- "lliu01/fortios_one_config",
259
  torch_dtype=torch.bfloat16,
260
  low_cpu_mem_usage=True
261
  )
 
67
  ["What are services in FortiOS and how are they used in firewall policies?"],
68
  ],
69
  """
70
+ sys_prompt = "FortiOS firewall configuration in CLI.\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  if __name__ == "__main__":
73
  args = parse_args()
74
+ tokenizer = AutoTokenizer.from_pretrained("lliu01/fortios")
75
  model = AutoModelForCausalLM.from_pretrained(
76
+ "lliu01/fortios",
77
  torch_dtype=torch.bfloat16,
78
  low_cpu_mem_usage=True
79
  )