Spaces:
Build error
Build error
delete comments
Browse files
utils.py
CHANGED
@@ -147,11 +147,8 @@ def get_answer(docs: List[Document], query: str) -> Dict[str, Any]:
|
|
147 |
"""Gets an answer to a question from a list of Documents."""
|
148 |
|
149 |
# Get the answer
|
150 |
-
|
151 |
chain = load_qa_with_sources_chain(OpenAI(temperature=0, openai_api_key=st.session_state.get("OPENAI_API_KEY")), chain_type="stuff", prompt=STUFF_PROMPT) # type: ignore
|
152 |
|
153 |
-
# Cohere doesn't work very well as of now.
|
154 |
-
# chain = load_qa_with_sources_chain(Cohere(temperature=0), chain_type="stuff", prompt=STUFF_PROMPT) # type: ignore
|
155 |
answer = chain(
|
156 |
{"input_documents": docs, "question": query}, return_only_outputs=True
|
157 |
)
|
|
|
147 |
"""Gets an answer to a question from a list of Documents."""
|
148 |
|
149 |
# Get the answer
|
|
|
150 |
chain = load_qa_with_sources_chain(OpenAI(temperature=0, openai_api_key=st.session_state.get("OPENAI_API_KEY")), chain_type="stuff", prompt=STUFF_PROMPT) # type: ignore
|
151 |
|
|
|
|
|
152 |
answer = chain(
|
153 |
{"input_documents": docs, "question": query}, return_only_outputs=True
|
154 |
)
|