jgrivolla commited on
Commit
9c18562
·
verified ·
1 Parent(s): f005840

put task instruction at the end

Browse files

move the "system" prompt with the task instructions to the end, as the model appears to forget the instructions otherwise

Files changed (1) hide show
  1. rag.py +1 -1
rag.py CHANGED
@@ -44,7 +44,7 @@ class RAG:
44
 
45
  #sys_prompt = "You are a helpful assistant. Answer the question using only the context you are provided with. If it is not possible to do it with the context, just say 'I can't answer'. <|endoftext|>"
46
  #query = f"Context:\n{context}\n\nQuestion:\n{instruction}"
47
- query = f"{sys_prompt}\n\nContext:\n{context}\n\nQuestion:\n{instruction}"
48
  print(query)
49
  #query = f"{sys_prompt}\n\nQuestion:\n{instruction}\n\nContext:\n{context}"
50
  chat_completion = client.chat.completions.create(
 
44
 
45
  #sys_prompt = "You are a helpful assistant. Answer the question using only the context you are provided with. If it is not possible to do it with the context, just say 'I can't answer'. <|endoftext|>"
46
  #query = f"Context:\n{context}\n\nQuestion:\n{instruction}"
47
+ query = f"Context:\n{context}\n\nQuestion:\n{instruction}\n\n{sys_prompt}"
48
  print(query)
49
  #query = f"{sys_prompt}\n\nQuestion:\n{instruction}\n\nContext:\n{context}"
50
  chat_completion = client.chat.completions.create(