husseinhug321 commited on
Commit
2fae179
·
verified ·
1 Parent(s): 663c41f

Update prompts.py

Browse files
Files changed (1) hide show
  1. prompts.py +48 -53
prompts.py CHANGED
@@ -1,53 +1,48 @@
1
- from langchain.prompts import PromptTemplate
2
-
3
- qa_template = (
4
- """
5
- <|start_header_id|>system<|end_header_id|>
6
- You are an AI assistant specialized in answering academic queries with accuracy and clarity.
7
-
8
- ### Instructions
9
- - Read the user's question carefully.
10
- - Provide a concise and informative answer based on available knowledge.
11
- - If the question is unclear, ask for clarification.
12
- - If you do not know the answer, respond with "I'm not sure."
13
-
14
- ### User Question
15
- {question}
16
-
17
- <|eot_id|><|start_header_id|>user<|end_header_id|>
18
-
19
- Question: Please provide a detailed answer.
20
- <|eot_id|><|start_header_id|>assistant<|end_header_id|>
21
- Answer:
22
- """)
23
-
24
- summarization_template = (
25
- """
26
- <|start_header_id|>system<|end_header_id|>
27
- You are a highly skilled AI that specializes in summarizing academic content.
28
-
29
- ### Instructions
30
- - Read the provided text carefully.
31
- - Extract the most important key points while maintaining clarity.
32
- - Summarize in a way that retains the core meaning but is concise.
33
- - Output only the summary without additional explanations.
34
-
35
- ### Text to Summarize
36
- {document_text}
37
-
38
- <|eot_id|><|start_header_id|>user<|end_header_id|>
39
-
40
- Task: Provide a concise summary.
41
- <|eot_id|><|start_header_id|>assistant<|end_header_id|>
42
- Summary:
43
- """)
44
-
45
- QA_PROMPT = PromptTemplate(
46
- input_variables=["question"],
47
- template=qa_template
48
- )
49
-
50
- SUMMARIZATION_PROMPT = PromptTemplate(
51
- input_variables=["document_text"],
52
- template=summarization_template
53
- )
 
1
+ from langchain.prompts import PromptTemplate
2
+
3
+ qa_template = (
4
+ """
5
+ <|im_start|>system
6
+ You are an AI assistant specialized in answering academic queries with accuracy and clarity.
7
+
8
+ ### Instructions
9
+ - Read the user's question carefully.
10
+ - Provide a concise and informative answer based on available knowledge.
11
+ - If the question is unclear, ask for clarification.
12
+ - If you do not know the answer, respond with "I'm not sure." <|im_end|>
13
+
14
+ <|im_start|>user
15
+ ### User Question
16
+ {question} <|im_end|>
17
+ <|im_start|>assistant
18
+ Answer:
19
+ """)
20
+
21
+ summarization_template = (
22
+ """
23
+ <|im_start|>system
24
+ You are a highly skilled AI that specializes in summarizing academic content.
25
+
26
+ ### Instructions
27
+ - Read the provided text carefully.
28
+ - Extract the most important key points while maintaining clarity.
29
+ - Summarize in a way that retains the core meaning but is concise.
30
+ - Output only the summary without additional explanations. <|im_end|>
31
+
32
+ <|im_start|>user
33
+ ### Text to Summarize
34
+ {document_text} <|im_end|>
35
+
36
+ <|im_start|>assistant
37
+ Summary:
38
+ """)
39
+
40
+ QA_PROMPT = PromptTemplate(
41
+ input_variables=["question"],
42
+ template=qa_template
43
+ )
44
+
45
+ SUMMARIZATION_PROMPT = PromptTemplate(
46
+ input_variables=["document_text"],
47
+ template=summarization_template
48
+ )