pgurazada1 commited on
Commit
21b9413
·
verified ·
1 Parent(s): 2ddd7ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -1,14 +1,15 @@
1
  import os
2
  import gradio as gr
3
 
4
- from openai import OpenAI
5
 
6
- client = OpenAI(
7
- base_url="https://api.endpoints.anyscale.com/v1",
8
- api_key=os.environ['ANYSCALE_API_KEY']
 
9
  )
10
 
11
- model_name = "meta-llama/Meta-Llama-3-70B-Instruct"
12
 
13
  groundedness_rater_system_message = """
14
  You are tasked with rating AI generated answers to questions posed by users.
@@ -123,6 +124,7 @@ demo = gr.Interface(
123
  examples=[[["What was the increase in annual revenue in 2022 compared to 2021?"],
124
  ["Here are some documents that are relevant to the question mentioned below. In 2022, we recognized total revenues of $81.46 billion, respectively, representing an increase of $27.64 billion, compared to the prior year. We continue to ramp production, build new manufacturing capacity and expand our operations to enable increased deliveries and deployments of our products and further revenue growth."],
125
  ["$27.64 billion."]]],
 
126
  concurrency_limit=16
127
  )
128
 
 
1
  import os
2
  import gradio as gr
3
 
4
+ from openai import AzureOpenAI
5
 
6
+ client = AzureOpenAI(
7
+ api_key=os.environ["AZURE_OPENAI_KEY"],
8
+ azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
9
+ api_version="2024-02-01"
10
  )
11
 
12
+ model_name = "gpt-4o-mini"
13
 
14
  groundedness_rater_system_message = """
15
  You are tasked with rating AI generated answers to questions posed by users.
 
124
  examples=[[["What was the increase in annual revenue in 2022 compared to 2021?"],
125
  ["Here are some documents that are relevant to the question mentioned below. In 2022, we recognized total revenues of $81.46 billion, respectively, representing an increase of $27.64 billion, compared to the prior year. We continue to ramp production, build new manufacturing capacity and expand our operations to enable increased deliveries and deployments of our products and further revenue growth."],
126
  ["$27.64 billion."]]],
127
+ cache_examples=False,
128
  concurrency_limit=16
129
  )
130