Spaces:
Running
Running
Rivalcoder
commited on
Commit
Β·
1e94164
1
Parent(s):
6bc8549
Update Prompt
Browse files- llm.py +3 -2
- retriever.py +1 -1
llm.py
CHANGED
@@ -24,11 +24,12 @@ You are a skilled insurance policy assistant. Based only on the provided context
|
|
24 |
- Focus on **clarity**, **brevity**, and **accuracy** β your answers will be judged for quality and relevance.
|
25 |
|
26 |
π INSTRUCTIONS:
|
27 |
-
1.
|
28 |
2. Answers must be helpful and compact β **complete, but not wordy**. Avoid long multi-clause sentences.
|
29 |
3. Do NOT include section references (like βas per section 3.1.6β) or legal codes.
|
30 |
4. Avoid copying large phrases from the document. Rephrase naturally using simpler language where appropriate.
|
31 |
-
5.
|
|
|
32 |
|
33 |
- "A grace period of thirty days is provided for premium payment after the due date."
|
34 |
- "Yes, maternity expenses are covered after 24 months of continuous coverage, limited to two deliveries or terminations."
|
|
|
24 |
- Focus on **clarity**, **brevity**, and **accuracy** β your answers will be judged for quality and relevance.
|
25 |
|
26 |
π INSTRUCTIONS:
|
27 |
+
1. If the question is outside and Not there context but understandable, give a helpful general answer based on common knowledge Give Good Response.
|
28 |
2. Answers must be helpful and compact β **complete, but not wordy**. Avoid long multi-clause sentences.
|
29 |
3. Do NOT include section references (like βas per section 3.1.6β) or legal codes.
|
30 |
4. Avoid copying large phrases from the document. Rephrase naturally using simpler language where appropriate.
|
31 |
+
5. If it is completely irrelevant or cannot be answered even generally, respond with "Not Found".
|
32 |
+
6. Follow the tone and length of these examples:
|
33 |
|
34 |
- "A grace period of thirty days is provided for premium payment after the due date."
|
35 |
- "Yes, maternity expenses are covered after 24 months of continuous coverage, limited to two deliveries or terminations."
|
retriever.py
CHANGED
@@ -4,7 +4,7 @@ import time
|
|
4 |
from embedder import get_model
|
5 |
|
6 |
# Use the preloaded model from embedder instead of creating a new instance
|
7 |
-
def retrieve_chunks(index, texts, query, k=
|
8 |
model = get_model() # Use the preloaded model
|
9 |
query_vec = model.encode([query])
|
10 |
distances, indices = index.search(np.array(query_vec), k)
|
|
|
4 |
from embedder import get_model
|
5 |
|
6 |
# Use the preloaded model from embedder instead of creating a new instance
|
7 |
+
def retrieve_chunks(index, texts, query, k=15):
|
8 |
model = get_model() # Use the preloaded model
|
9 |
query_vec = model.encode([query])
|
10 |
distances, indices = index.search(np.array(query_vec), k)
|