Change model
Browse files
app.py
CHANGED
@@ -60,10 +60,10 @@ def predict(message, history, system_prompt, temperature, max_tokens):
|
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
args = parse_args()
|
63 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
64 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
65 |
model = AutoModelForCausalLM.from_pretrained(
|
66 |
-
|
67 |
torch_dtype=torch.bfloat16,
|
68 |
low_cpu_mem_usage=True
|
69 |
)
|
@@ -71,8 +71,8 @@ if __name__ == "__main__":
|
|
71 |
model = model.to(device)
|
72 |
gr.ChatInterface(
|
73 |
predict,
|
74 |
-
title="
|
75 |
-
description="
|
76 |
theme="soft",
|
77 |
chatbot=gr.Chatbot(label="Chat History",),
|
78 |
textbox=gr.Textbox(placeholder="input", container=False, scale=7),
|
@@ -80,18 +80,18 @@ if __name__ == "__main__":
|
|
80 |
undo_btn="Delete Previous",
|
81 |
clear_btn="Clear",
|
82 |
additional_inputs=[
|
83 |
-
gr.Textbox("
|
84 |
gr.Slider(0, 1, 0.5, label="Temperature"),
|
85 |
gr.Slider(100, 2048, 1024, label="Max Tokens"),
|
86 |
],
|
87 |
examples=[
|
88 |
-
["
|
89 |
-
["
|
90 |
-
["
|
91 |
-
["
|
92 |
-
["
|
93 |
-
["
|
94 |
-
["
|
95 |
],
|
96 |
additional_inputs_accordion_name="Parameters",
|
97 |
).queue().launch()
|
|
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
args = parse_args()
|
63 |
+
tokenizer = AutoTokenizer.from_pretrained("lliu01/fortios_cli")
|
64 |
+
tokenizer = AutoTokenizer.from_pretrained("lliu01/fortios_cli")
|
65 |
model = AutoModelForCausalLM.from_pretrained(
|
66 |
+
"lliu01/fortios_cli",
|
67 |
torch_dtype=torch.bfloat16,
|
68 |
low_cpu_mem_usage=True
|
69 |
)
|
|
|
71 |
model = model.to(device)
|
72 |
gr.ChatInterface(
|
73 |
predict,
|
74 |
+
title="FortiOS CLI Chat - Demo",
|
75 |
+
description="FortiOS CLI Chat",
|
76 |
theme="soft",
|
77 |
chatbot=gr.Chatbot(label="Chat History",),
|
78 |
textbox=gr.Textbox(placeholder="input", container=False, scale=7),
|
|
|
80 |
undo_btn="Delete Previous",
|
81 |
clear_btn="Clear",
|
82 |
additional_inputs=[
|
83 |
+
gr.Textbox("FortiOS firewall policy configuration.", label="System Prompt"),
|
84 |
gr.Slider(0, 1, 0.5, label="Temperature"),
|
85 |
gr.Slider(100, 2048, 1024, label="Max Tokens"),
|
86 |
],
|
87 |
examples=[
|
88 |
+
["How can you move a policy by policy ID?"],
|
89 |
+
["What is the command to enable security profiles in a firewall policy?"],
|
90 |
+
["How do you configure a service group in the GUI?"],
|
91 |
+
["How can you configure the firewall policy change summary in the CLI?"],
|
92 |
+
["How do you disable hardware acceleration for an IPv4 firewall policy in the CLI?"],
|
93 |
+
["How can you enable WAN optimization in a firewall policy using the CLI?"],
|
94 |
+
["What are services in FortiOS and how are they used in firewall policies?"],
|
95 |
],
|
96 |
additional_inputs_accordion_name="Parameters",
|
97 |
).queue().launch()
|