Spaces:
Sleeping
Sleeping
Update QnA.py
Browse files
QnA.py
CHANGED
|
@@ -16,7 +16,7 @@ load_dotenv()
|
|
| 16 |
def prompt_template_to_analyze_resume():
|
| 17 |
template = """
|
| 18 |
You are provided with the Resume of the Candidate in the context below . As an Talent Aquistion bot , your task is to provide insights about the
|
| 19 |
-
candidate.
|
| 20 |
|
| 21 |
\n\n:{context}
|
| 22 |
"""
|
|
@@ -65,9 +65,10 @@ def get_hugging_face_model(model_id='mistralai/Mistral-7B-Instruct-v0.2',tempera
|
|
| 65 |
return llm
|
| 66 |
|
| 67 |
def Q_A(vectorstore,question,API_KEY):
|
|
|
|
| 68 |
if API_KEY.startswith('gsk'):
|
| 69 |
os.environ["GROQ_API_KEY"] = API_KEY
|
| 70 |
-
chat_llm = ChatGroq(model="
|
| 71 |
elif API_KEY.startswith('hf'):
|
| 72 |
chat_llm = get_hugging_face_model(api_key=API_KEY)
|
| 73 |
|
|
@@ -85,4 +86,5 @@ def Q_A(vectorstore,question,API_KEY):
|
|
| 85 |
|
| 86 |
chain = create_retrieval_chain(compression_retriever, question_answer_chain)
|
| 87 |
result = chain.invoke({'input':question})
|
| 88 |
-
return result['answer']
|
|
|
|
|
|
| 16 |
def prompt_template_to_analyze_resume():
|
| 17 |
template = """
|
| 18 |
You are provided with the Resume of the Candidate in the context below . As an Talent Aquistion bot , your task is to provide insights about the
|
| 19 |
+
candidate in precise manner.
|
| 20 |
|
| 21 |
\n\n:{context}
|
| 22 |
"""
|
|
|
|
| 65 |
return llm
|
| 66 |
|
| 67 |
def Q_A(vectorstore,question,API_KEY):
|
| 68 |
+
|
| 69 |
if API_KEY.startswith('gsk'):
|
| 70 |
os.environ["GROQ_API_KEY"] = API_KEY
|
| 71 |
+
chat_llm = ChatGroq(model="llama3-8b-8192") # (model="gemma2-9b-it")
|
| 72 |
elif API_KEY.startswith('hf'):
|
| 73 |
chat_llm = get_hugging_face_model(api_key=API_KEY)
|
| 74 |
|
|
|
|
| 86 |
|
| 87 |
chain = create_retrieval_chain(compression_retriever, question_answer_chain)
|
| 88 |
result = chain.invoke({'input':question})
|
| 89 |
+
return result['answer']
|
| 90 |
+
|