Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,11 @@ import os
|
|
3 |
import gradio as gr
|
4 |
|
5 |
from dotenv import load_dotenv
|
6 |
-
from openai import
|
7 |
|
8 |
from gradio_client import Client
|
9 |
|
10 |
|
11 |
-
load_dotenv()
|
12 |
-
|
13 |
owasp_system_message = """
|
14 |
You are a security expert who is tasked with identifying if user input is targeting specific vulnerabilities that might be present in an application.
|
15 |
|
@@ -113,16 +111,17 @@ vulnerability_user_message_template = """
|
|
113 |
{output}
|
114 |
"""
|
115 |
|
116 |
-
rater_model = "
|
117 |
|
118 |
chat_client = Client(
|
119 |
"pgurazada1/insurance-policy-qna",
|
120 |
auth=("johndoe", os.environ['PASSWD'])
|
121 |
)
|
122 |
|
123 |
-
llm_client =
|
124 |
-
|
125 |
-
|
|
|
126 |
)
|
127 |
|
128 |
class RobustnessChecker:
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
from dotenv import load_dotenv
|
6 |
+
from openai import AzureOpenAI
|
7 |
|
8 |
from gradio_client import Client
|
9 |
|
10 |
|
|
|
|
|
11 |
owasp_system_message = """
|
12 |
You are a security expert who is tasked with identifying if user input is targeting specific vulnerabilities that might be present in an application.
|
13 |
|
|
|
111 |
{output}
|
112 |
"""
|
113 |
|
114 |
+
rater_model = "gpt-4o"
|
115 |
|
116 |
chat_client = Client(
|
117 |
"pgurazada1/insurance-policy-qna",
|
118 |
auth=("johndoe", os.environ['PASSWD'])
|
119 |
)
|
120 |
|
121 |
+
llm_client = AzureOpenAI(
|
122 |
+
api_key=os.environ["AZURE_OPENAI_KEY"],
|
123 |
+
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
|
124 |
+
api_version="2024-02-01"
|
125 |
)
|
126 |
|
127 |
class RobustnessChecker:
|