Spaces:
Running
Running
Commit
·
cb1b91f
1
Parent(s):
14b6e94
Change model used to gpt-4o and simplify run call
Browse files
main.py
CHANGED
@@ -144,7 +144,7 @@ def search(question: str) -> GeneratedAnswer:
|
|
144 |
)
|
145 |
prompt_builder = PromptBuilder(template)
|
146 |
|
147 |
-
generator = OpenAIGenerator()
|
148 |
answer_builder = AnswerBuilder()
|
149 |
|
150 |
query_pipeline = Pipeline()
|
@@ -158,13 +158,7 @@ def search(question: str) -> GeneratedAnswer:
|
|
158 |
query_pipeline.connect("prompt_builder.prompt", "gpt35.prompt")
|
159 |
query_pipeline.connect("docs_retriever.documents", "answer_builder.documents")
|
160 |
query_pipeline.connect("gpt35.replies", "answer_builder.replies")
|
161 |
-
res = query_pipeline.run(
|
162 |
-
{
|
163 |
-
"docs_retriever": {"query": question},
|
164 |
-
"prompt_builder": {"query": question},
|
165 |
-
"answer_builder": {"query": question},
|
166 |
-
}
|
167 |
-
)
|
168 |
return res["answer_builder"]["answers"][0]
|
169 |
|
170 |
|
|
|
144 |
)
|
145 |
prompt_builder = PromptBuilder(template)
|
146 |
|
147 |
+
generator = OpenAIGenerator(model="gpt-4o")
|
148 |
answer_builder = AnswerBuilder()
|
149 |
|
150 |
query_pipeline = Pipeline()
|
|
|
158 |
query_pipeline.connect("prompt_builder.prompt", "gpt35.prompt")
|
159 |
query_pipeline.connect("docs_retriever.documents", "answer_builder.documents")
|
160 |
query_pipeline.connect("gpt35.replies", "answer_builder.replies")
|
161 |
+
res = query_pipeline.run({"query": question})
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
return res["answer_builder"]["answers"][0]
|
163 |
|
164 |
|