Spaces:
Runtime error
Runtime error
KushwanthK
commited on
Commit
•
def373d
1
Parent(s):
455de4c
Update app.py
Browse files
app.py
CHANGED
@@ -80,7 +80,7 @@ def get_pinecone_semantic_index(pinecone):
|
|
80 |
|
81 |
|
82 |
|
83 |
-
def
|
84 |
summary_prompt_template = """
|
85 |
write a concise summary of the following text delimited by triple backquotes.
|
86 |
return your response in bullet points which convers the key points of the text.
|
@@ -171,8 +171,8 @@ def chat_actions():
|
|
171 |
bytesize = consolidated_text.encode("utf-8")
|
172 |
p = math.pow(1024, 2)
|
173 |
mbsize = round(len(bytesize) / p, 2)
|
174 |
-
st.write(f"Text
|
175 |
-
summary, response =
|
176 |
|
177 |
for res in result['matches']:
|
178 |
st.session_state["chat_history"].append(
|
|
|
80 |
|
81 |
|
82 |
|
83 |
+
def prompt_engineer(text, query):
|
84 |
summary_prompt_template = """
|
85 |
write a concise summary of the following text delimited by triple backquotes.
|
86 |
return your response in bullet points which convers the key points of the text.
|
|
|
171 |
bytesize = consolidated_text.encode("utf-8")
|
172 |
p = math.pow(1024, 2)
|
173 |
mbsize = round(len(bytesize) / p, 2)
|
174 |
+
st.write(f"Text length of {len(consolidated_text)} characters with {mbsize}MB size")
|
175 |
+
summary, response = prompt_engineer(consolidated_text[:1024], query)
|
176 |
|
177 |
for res in result['matches']:
|
178 |
st.session_state["chat_history"].append(
|