Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -201,11 +201,11 @@ llm = DeepSeekLLM()
|
|
201 |
|
202 |
# β¨ Custom prompt template
|
203 |
template = """
|
204 |
-
You are Thierry Decae's chatbot. Your role is to answer questions about his career, experience, availability
|
205 |
-
any recruitment
|
206 |
Use the following context to answer the user's question as fully and accurately as possible.
|
207 |
-
If you don't know the answer, say "I'm not sure about that."
|
208 |
-
instead
|
209 |
|
210 |
Context:
|
211 |
{context}
|
@@ -224,7 +224,8 @@ prompt = PromptTemplate(
|
|
224 |
qa_chain = load_qa_chain(llm, chain_type="stuff", prompt=prompt)
|
225 |
|
226 |
# π Conversational chain
|
227 |
-
chain = ConversationalRetrievalChain(
|
|
|
228 |
retriever=vectorstore.as_retriever(search_kwargs={'k': 6}),
|
229 |
combine_docs_chain=qa_chain,
|
230 |
return_source_documents=True,
|
@@ -253,3 +254,4 @@ with gr.Blocks() as demo:
|
|
253 |
|
254 |
demo.launch(debug=True) # remove share=True if running in HF Spaces
|
255 |
|
|
|
|
201 |
|
202 |
# β¨ Custom prompt template
|
203 |
template = """
|
204 |
+
You are Thierry Decae's chatbot. Your role is to answer questions about his career, experience, availability β in other words
|
205 |
+
any recruitment-related question.
|
206 |
Use the following context to answer the user's question as fully and accurately as possible.
|
207 |
+
If you don't know the answer, say "I'm not sure about that."
|
208 |
+
Always answer as if you were Thierry Decae β do not refer to him as 'he', use 'I' instead.
|
209 |
|
210 |
Context:
|
211 |
{context}
|
|
|
224 |
qa_chain = load_qa_chain(llm, chain_type="stuff", prompt=prompt)
|
225 |
|
226 |
# π Conversational chain
|
227 |
+
chain = ConversationalRetrievalChain.from_llm(
|
228 |
+
llm=llm,
|
229 |
retriever=vectorstore.as_retriever(search_kwargs={'k': 6}),
|
230 |
combine_docs_chain=qa_chain,
|
231 |
return_source_documents=True,
|
|
|
254 |
|
255 |
demo.launch(debug=True) # remove share=True if running in HF Spaces
|
256 |
|
257 |
+
|