Spaces:
Running
Running
Update rag.py
Browse files
rag.py
CHANGED
@@ -42,8 +42,10 @@ class RAG:
|
|
42 |
api_key=os.getenv("HF_TOKEN")
|
43 |
)
|
44 |
|
45 |
-
|
46 |
-
#
|
|
|
|
|
47 |
chat_completion = client.chat.completions.create(
|
48 |
model="tgi",
|
49 |
messages=[
|
|
|
42 |
api_key=os.getenv("HF_TOKEN")
|
43 |
)
|
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 |
+
#query = f"{sys_prompt}\n\nQuestion:\n{instruction}\n\nContext:\n{context}"
|
49 |
chat_completion = client.chat.completions.create(
|
50 |
model="tgi",
|
51 |
messages=[
|