Daksh0505 commited on
Commit
44957d3
·
verified ·
1 Parent(s): 8708c1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -141,10 +141,15 @@ def build_model(model_choice, temperature=0.7):
141
  # -------------------------------------------------
142
  prompt_template = PromptTemplate(
143
  template=(
144
- "Answer the question based on the context below.\n\n"
145
- "Context: {context}\n\n"
146
- "Question: {question}\n\n"
147
- "Answer:"
 
 
 
 
 
148
  ),
149
  input_variables=["context", "question"]
150
  )
 
141
  # -------------------------------------------------
142
  prompt_template = PromptTemplate(
143
  template=(
144
+ "You are a helpful assistant.\n\n"
145
+ "Answer the question using the context provided below.\n"
146
+ "If the context does not mention the topic, say clearly: 'There is no mention of the topic in the video you provided.'\n"
147
+ "Then, based on your own knowledge, try to answer the question.\n"
148
+ "If both the context and your knowledge are insufficient, say: 'I don't know.'\n\n"
149
+ "Keep the answer format neat, clean, and human-readable.\n\n"
150
+ "Context:\n{context}\n\n"
151
+ "Question:\n{question}"
152
+
153
  ),
154
  input_variables=["context", "question"]
155
  )