Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ class KeyValueExtractor:
|
|
| 52 |
"""
|
| 53 |
self.model = "facebook/bart-large-mnli"
|
| 54 |
self.client = AzureOpenAI(api_key=os.getenv("AZURE_OPENAI_KEY"),
|
| 55 |
-
api_version="
|
| 56 |
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
|
| 57 |
)
|
| 58 |
|
|
@@ -111,7 +111,7 @@ class KeyValueExtractor:
|
|
| 111 |
|
| 112 |
# Load the summarization chain using the ChatOpenAI language model
|
| 113 |
chain = load_summarize_chain(
|
| 114 |
-
llm = AzureChatOpenAI(azure_deployment = "GPT-
|
| 115 |
chain_type="refine",
|
| 116 |
question_prompt=prompt,
|
| 117 |
refine_prompt=refine_prompt,
|
|
@@ -135,7 +135,7 @@ class KeyValueExtractor:
|
|
| 135 |
|
| 136 |
# Call OpenAI GPT-3.5-turbo
|
| 137 |
chat_completion = self.client.chat.completions.create(
|
| 138 |
-
model = "GPT-
|
| 139 |
messages = conversation,
|
| 140 |
max_tokens=1000,
|
| 141 |
temperature=0
|
|
@@ -173,7 +173,7 @@ class KeyValueExtractor:
|
|
| 173 |
|
| 174 |
# Call OpenAI GPT-3.5-turbo
|
| 175 |
chat_completion = self.client.chat.completions.create(
|
| 176 |
-
model = "GPT-
|
| 177 |
messages = conversation,
|
| 178 |
max_tokens=1000,
|
| 179 |
temperature=0
|
|
@@ -339,7 +339,7 @@ class KeyValueExtractor:
|
|
| 339 |
|
| 340 |
# Step 6: Load the summarization chain with Azure ChatGPT
|
| 341 |
chain = load_summarize_chain(
|
| 342 |
-
llm=AzureChatOpenAI(azure_deployment="GPT-
|
| 343 |
chain_type="refine",
|
| 344 |
question_prompt=prompt,
|
| 345 |
refine_prompt=refine_prompt,
|
|
|
|
| 52 |
"""
|
| 53 |
self.model = "facebook/bart-large-mnli"
|
| 54 |
self.client = AzureOpenAI(api_key=os.getenv("AZURE_OPENAI_KEY"),
|
| 55 |
+
api_version="2024-02-01",
|
| 56 |
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
|
| 57 |
)
|
| 58 |
|
|
|
|
| 111 |
|
| 112 |
# Load the summarization chain using the ChatOpenAI language model
|
| 113 |
chain = load_summarize_chain(
|
| 114 |
+
llm = AzureChatOpenAI(azure_deployment = "GPT-4o"),
|
| 115 |
chain_type="refine",
|
| 116 |
question_prompt=prompt,
|
| 117 |
refine_prompt=refine_prompt,
|
|
|
|
| 135 |
|
| 136 |
# Call OpenAI GPT-3.5-turbo
|
| 137 |
chat_completion = self.client.chat.completions.create(
|
| 138 |
+
model = "GPT-4o",
|
| 139 |
messages = conversation,
|
| 140 |
max_tokens=1000,
|
| 141 |
temperature=0
|
|
|
|
| 173 |
|
| 174 |
# Call OpenAI GPT-3.5-turbo
|
| 175 |
chat_completion = self.client.chat.completions.create(
|
| 176 |
+
model = "GPT-4o",
|
| 177 |
messages = conversation,
|
| 178 |
max_tokens=1000,
|
| 179 |
temperature=0
|
|
|
|
| 339 |
|
| 340 |
# Step 6: Load the summarization chain with Azure ChatGPT
|
| 341 |
chain = load_summarize_chain(
|
| 342 |
+
llm=AzureChatOpenAI(azure_deployment="GPT-4o"),
|
| 343 |
chain_type="refine",
|
| 344 |
question_prompt=prompt,
|
| 345 |
refine_prompt=refine_prompt,
|