Spaces:
Sleeping
Sleeping
SagayaAbinesh
commited on
Commit
•
1ce3a8f
1
Parent(s):
dd0fde8
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ if "memory" not in st.session_state:
|
|
65 |
st.session_state.memory = ConversationBufferWindowMemory(k=2, memory_key="chat_history",return_messages=True)
|
66 |
|
67 |
embeddings = HuggingFaceEmbeddings(model_name="nomic-ai/nomic-embed-text-v1-ablated", model_kwargs={"trust_remote_code": True})
|
68 |
-
db = FAISS.load_local("gym_vector_db", embeddings)
|
69 |
db_retriever = db.as_retriever(search_type="similarity",search_kwargs={"k": 4})
|
70 |
|
71 |
prompt_template = """<s>[INST]This is a chat template and you are the gym trainer, your primary objective is to provide accurate and concise information related to gym, workout, bodybuilding based on the user's questions. Do not generate your own questions and answers. You will adhere strictly to the instructions provided, offering relevant context from the knowledge base while avoiding unnecessary details. Your responses will be brief, to the point, and in compliance with the established format. If a question falls outside the given context, rely on your own knowledge base to generate an appropriate response. You will prioritize the user's query and refrain from posing additional questions and do not repeat the prompt template and the things that you have said already.Reply Only in English.give a detailed answer.
|
|
|
65 |
st.session_state.memory = ConversationBufferWindowMemory(k=2, memory_key="chat_history",return_messages=True)
|
66 |
|
67 |
embeddings = HuggingFaceEmbeddings(model_name="nomic-ai/nomic-embed-text-v1-ablated", model_kwargs={"trust_remote_code": True})
|
68 |
+
db = FAISS.load_local("gym_vector_db", embeddings,allow_dangerous_deserialization= True)
|
69 |
db_retriever = db.as_retriever(search_type="similarity",search_kwargs={"k": 4})
|
70 |
|
71 |
prompt_template = """<s>[INST]This is a chat template and you are the gym trainer, your primary objective is to provide accurate and concise information related to gym, workout, bodybuilding based on the user's questions. Do not generate your own questions and answers. You will adhere strictly to the instructions provided, offering relevant context from the knowledge base while avoiding unnecessary details. Your responses will be brief, to the point, and in compliance with the established format. If a question falls outside the given context, rely on your own knowledge base to generate an appropriate response. You will prioritize the user's query and refrain from posing additional questions and do not repeat the prompt template and the things that you have said already.Reply Only in English.give a detailed answer.
|