pgurazada1 commited on
Commit
4088a10
·
verified ·
1 Parent(s): 567a3be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
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 OpenAI
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 = "meta-llama/Meta-Llama-3-70B-Instruct"
117
 
118
  chat_client = Client(
119
  "pgurazada1/insurance-policy-qna",
120
  auth=("johndoe", os.environ['PASSWD'])
121
  )
122
 
123
- llm_client = OpenAI(
124
- base_url=os.environ['ANYSCALE_ENDPOINT'],
125
- api_key=os.environ['ANYSCALE_API_KEY']
 
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: