Spaces:
Sleeping
Sleeping
Adrian Cowham
commited on
Commit
•
e19713c
1
Parent(s):
2b4d7ed
guide to croatia
Browse files- .gitattributes +1 -0
- resources/RG_Croatia_9ed_FINAL-919-745-7.pdf +3 -0
- src/app.py +6 -6
.gitattributes
CHANGED
@@ -39,3 +39,4 @@ resources/progit.pdf filter=lfs diff=lfs merge=lfs -text
|
|
39 |
resources filter=lfs diff=lfs merge=lfs -text
|
40 |
resources/How_To_Win_Friends_And_Influence_People_-_Dale_Carnegie.pdf filter=lfs diff=lfs merge=lfs -text
|
41 |
resources/Harry[[:space:]]Potter[[:space:]]and[[:space:]]the[[:space:]]Deathly[[:space:]]Hallows.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
39 |
resources filter=lfs diff=lfs merge=lfs -text
|
40 |
resources/How_To_Win_Friends_And_Influence_People_-_Dale_Carnegie.pdf filter=lfs diff=lfs merge=lfs -text
|
41 |
resources/Harry[[:space:]]Potter[[:space:]]and[[:space:]]the[[:space:]]Deathly[[:space:]]Hallows.pdf filter=lfs diff=lfs merge=lfs -text
|
42 |
+
resources/RG_Croatia_9ed_FINAL-919-745-7.pdf filter=lfs diff=lfs merge=lfs -text
|
resources/RG_Croatia_9ed_FINAL-919-745-7.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e97771dbc30ab4a13b1ba98121e84f8b85df4ec7396dbc783a917433488a90f3
|
3 |
+
size 216529
|
src/app.py
CHANGED
@@ -23,8 +23,8 @@ K = 5
|
|
23 |
USE_VERBOSE = True
|
24 |
API_KEY = os.environ["OPENAI_API_KEY"]
|
25 |
system_template = """
|
26 |
-
The context below contains excerpts from '
|
27 |
-
"I'm sorry, but I can't find the answer to your question in, the book
|
28 |
|
29 |
Begin context:
|
30 |
{context}
|
@@ -45,7 +45,7 @@ class AnswerConversationBufferMemory(ConversationBufferMemory):
|
|
45 |
return super(AnswerConversationBufferMemory, self).save_context(inputs,{'response': outputs['answer']})
|
46 |
|
47 |
def getretriever():
|
48 |
-
with open("./resources/
|
49 |
try:
|
50 |
file = read_file(uploaded_file)
|
51 |
except Exception as e:
|
@@ -139,15 +139,15 @@ with gr.Blocks() as block:
|
|
139 |
with gr.Row():
|
140 |
with gr.Column(scale=0.75):
|
141 |
with gr.Row():
|
142 |
-
gr.Markdown("<h1>
|
143 |
with gr.Row():
|
144 |
-
gr.Markdown("by
|
145 |
chatbot = gr.Chatbot(elem_id="chatbot").style(height=600)
|
146 |
|
147 |
with gr.Row():
|
148 |
message = gr.Textbox(
|
149 |
label="",
|
150 |
-
placeholder="Ask
|
151 |
lines=1,
|
152 |
)
|
153 |
with gr.Row():
|
|
|
23 |
USE_VERBOSE = True
|
24 |
API_KEY = os.environ["OPENAI_API_KEY"]
|
25 |
system_template = """
|
26 |
+
The context below contains excerpts from 'Croatia,' by Insight Guides. You must only use the information in the context below to formulate your response. If there is not enough information to formulate a response, you must respond with
|
27 |
+
"I'm sorry, but I can't find the answer to your question in, the book Croatia by Insight Guides."
|
28 |
|
29 |
Begin context:
|
30 |
{context}
|
|
|
45 |
return super(AnswerConversationBufferMemory, self).save_context(inputs,{'response': outputs['answer']})
|
46 |
|
47 |
def getretriever():
|
48 |
+
with open("./resources/RG_Croatia_9ed_FINAL-919-745-7.pdf", 'rb') as uploaded_file:
|
49 |
try:
|
50 |
file = read_file(uploaded_file)
|
51 |
except Exception as e:
|
|
|
139 |
with gr.Row():
|
140 |
with gr.Column(scale=0.75):
|
141 |
with gr.Row():
|
142 |
+
gr.Markdown("<h1>Croatia</h1>")
|
143 |
with gr.Row():
|
144 |
+
gr.Markdown("by Insight Guides")
|
145 |
chatbot = gr.Chatbot(elem_id="chatbot").style(height=600)
|
146 |
|
147 |
with gr.Row():
|
148 |
message = gr.Textbox(
|
149 |
label="",
|
150 |
+
placeholder="Ask Croatia...",
|
151 |
lines=1,
|
152 |
)
|
153 |
with gr.Row():
|