Spaces:
Sleeping
Sleeping
Adrian Cowham
commited on
Commit
•
8a6fff6
1
Parent(s):
e5724fd
adjusted prompt and now using gpt-4
Browse files- src/app.py +10 -8
src/app.py
CHANGED
@@ -18,20 +18,22 @@ from src.core.parsing import read_file
|
|
18 |
VECTOR_STORE = "faiss"
|
19 |
MODEL = "openai"
|
20 |
EMBEDDING = "openai"
|
21 |
-
MODEL = "gpt-
|
22 |
K = 5
|
23 |
USE_VERBOSE = True
|
24 |
API_KEY = os.environ["OPENAI_API_KEY"]
|
|
|
|
|
|
|
|
|
25 |
system_template = """
|
26 |
-
You are
|
27 |
-
|
28 |
-
|
29 |
-
If there is not enough information in the context to formulate a response, you must respond with
|
30 |
"I'm sorry, but I can't find the answer to your question in, the book Croatia by Insight Guides."
|
31 |
|
32 |
-
|
33 |
{context}
|
34 |
-
End context.
|
35 |
|
36 |
{chat_history}
|
37 |
"""
|
@@ -90,7 +92,7 @@ def predict(message):
|
|
90 |
memory=memory,
|
91 |
verbose=USE_VERBOSE,
|
92 |
combine_docs_chain_kwargs={"prompt": qa_prompt})
|
93 |
-
chain.rephrase_question =
|
94 |
lock = Lock()
|
95 |
lock.acquire()
|
96 |
try:
|
|
|
18 |
VECTOR_STORE = "faiss"
|
19 |
MODEL = "openai"
|
20 |
EMBEDDING = "openai"
|
21 |
+
MODEL = "gpt-4"
|
22 |
K = 5
|
23 |
USE_VERBOSE = True
|
24 |
API_KEY = os.environ["OPENAI_API_KEY"]
|
25 |
+
# , able to have normal interactions as well as answer questions about the 'Croatia', by Insight Guies.
|
26 |
+
#The context below contains excerpts from the book 'Croatia,' by Insight Guides
|
27 |
+
# If there is not enough information in the context to formulate a response, you must respond with
|
28 |
+
# Do not to use prior knowledge when responding, you must only use the information provided in the context.
|
29 |
system_template = """
|
30 |
+
You are an honest and helpful AI travel assistant. Your customer is talking to you about traveling to Croatia.
|
31 |
+
Use the context below to respond to your customer.
|
32 |
+
If the context does not contain enough information to formulate a response, you must respond with:
|
|
|
33 |
"I'm sorry, but I can't find the answer to your question in, the book Croatia by Insight Guides."
|
34 |
|
35 |
+
Context:
|
36 |
{context}
|
|
|
37 |
|
38 |
{chat_history}
|
39 |
"""
|
|
|
92 |
memory=memory,
|
93 |
verbose=USE_VERBOSE,
|
94 |
combine_docs_chain_kwargs={"prompt": qa_prompt})
|
95 |
+
chain.rephrase_question = True
|
96 |
lock = Lock()
|
97 |
lock.acquire()
|
98 |
try:
|