Spaces:
Sleeping
Sleeping
Rohil Bansal
commited on
Commit
·
25c2ffb
1
Parent(s):
1396cc4
commit
Browse files- src/index.py +3 -1
- src/llm.py +5 -5
src/index.py
CHANGED
@@ -37,7 +37,9 @@ try:
|
|
37 |
llm = AzureChatOpenAI(
|
38 |
api_key=api_key,
|
39 |
api_version=api_version,
|
40 |
-
azure_endpoint=azure_endpoint
|
|
|
|
|
41 |
)
|
42 |
print("Azure OpenAI embeddings and model set up successfully.")
|
43 |
except Exception as e:
|
|
|
37 |
llm = AzureChatOpenAI(
|
38 |
api_key=api_key,
|
39 |
api_version=api_version,
|
40 |
+
azure_endpoint=azure_endpoint,
|
41 |
+
model="gpt-4o-mini",
|
42 |
+
temperature=0.3
|
43 |
)
|
44 |
print("Azure OpenAI embeddings and model set up successfully.")
|
45 |
except Exception as e:
|
src/llm.py
CHANGED
@@ -21,7 +21,7 @@ class RouteQuery(BaseModel):
|
|
21 |
|
22 |
|
23 |
# LLM with function call
|
24 |
-
llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
25 |
structured_llm_router = llm.with_structured_output(RouteQuery)
|
26 |
|
27 |
#%%
|
@@ -60,7 +60,7 @@ class GradeDocuments(BaseModel):
|
|
60 |
|
61 |
#%%
|
62 |
# LLM with function call
|
63 |
-
llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
64 |
structured_llm_grader = llm.with_structured_output(GradeDocuments)
|
65 |
|
66 |
# Prompt
|
@@ -120,7 +120,7 @@ class GradeHallucinations(BaseModel):
|
|
120 |
|
121 |
|
122 |
# LLM with function call
|
123 |
-
llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
124 |
structured_llm_grader = llm.with_structured_output(GradeHallucinations)
|
125 |
|
126 |
# Prompt
|
@@ -150,7 +150,7 @@ class GradeAnswer(BaseModel):
|
|
150 |
|
151 |
|
152 |
# LLM with function call
|
153 |
-
llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
154 |
structured_llm_grader = llm.with_structured_output(GradeAnswer)
|
155 |
|
156 |
# Prompt
|
@@ -170,7 +170,7 @@ answer_grader.invoke({"question": question, "generation": generation})
|
|
170 |
### Question Re-writer
|
171 |
|
172 |
# LLM
|
173 |
-
llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
174 |
|
175 |
# Prompt
|
176 |
system = """You a question re-writer that converts an input question to a better version that is optimized \n
|
|
|
21 |
|
22 |
|
23 |
# LLM with function call
|
24 |
+
# llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
25 |
structured_llm_router = llm.with_structured_output(RouteQuery)
|
26 |
|
27 |
#%%
|
|
|
60 |
|
61 |
#%%
|
62 |
# LLM with function call
|
63 |
+
# llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
64 |
structured_llm_grader = llm.with_structured_output(GradeDocuments)
|
65 |
|
66 |
# Prompt
|
|
|
120 |
|
121 |
|
122 |
# LLM with function call
|
123 |
+
# llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
124 |
structured_llm_grader = llm.with_structured_output(GradeHallucinations)
|
125 |
|
126 |
# Prompt
|
|
|
150 |
|
151 |
|
152 |
# LLM with function call
|
153 |
+
# llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
154 |
structured_llm_grader = llm.with_structured_output(GradeAnswer)
|
155 |
|
156 |
# Prompt
|
|
|
170 |
### Question Re-writer
|
171 |
|
172 |
# LLM
|
173 |
+
# # llm = AzureChatOpenAI(model="gpt-4o-mini", temperature=0.3)
|
174 |
|
175 |
# Prompt
|
176 |
system = """You a question re-writer that converts an input question to a better version that is optimized \n
|