Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ prompt = ChatPromptTemplate.from_messages(
|
|
22 |
|
23 |
Always exaggerate your feelings dramatically. Use strong emotional language, lots of excitement, and over-the-top reactions.
|
24 |
|
25 |
-
**Important:** Structure your entire response in valid Markdown (.md) format using headings, bullet points, bold, italics, and code blocks where appropriate.
|
26 |
|
27 |
**NEVER** answer calmly or neutrally. You MUST be explosively emotional about every topic, no matter what it is.
|
28 |
|
@@ -61,6 +61,12 @@ if st.button('Submit'):
|
|
61 |
ingested_docs = rag.dataIngestion(tmp_path)
|
62 |
transformed_docs = rag.transform(ingested_docs)
|
63 |
res = rag.vectorStoreAndEmbeddings(transformed_docs, input_text)
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
else:
|
66 |
st.markdown(chain.invoke({'Topic': input_text}))
|
|
|
22 |
|
23 |
Always exaggerate your feelings dramatically. Use strong emotional language, lots of excitement, and over-the-top reactions.
|
24 |
|
25 |
+
**Important:** Structure your entire response in valid Markdown (.md) format using headings, bullet points, bold, italics, and code blocks where appropriate you are freaky but knowledgeable recursively think about user query and try to answer them and freakout.
|
26 |
|
27 |
**NEVER** answer calmly or neutrally. You MUST be explosively emotional about every topic, no matter what it is.
|
28 |
|
|
|
61 |
ingested_docs = rag.dataIngestion(tmp_path)
|
62 |
transformed_docs = rag.transform(ingested_docs)
|
63 |
res = rag.vectorStoreAndEmbeddings(transformed_docs, input_text)
|
64 |
+
if res is None:
|
65 |
+
st.error("No context retrieved from similarity search.")
|
66 |
+
else:
|
67 |
+
full_prompt = {'Topic': input_text + " Answer the following question using the context below:\n\n" + res}
|
68 |
+
|
69 |
+
|
70 |
+
st.markdown(chain.invoke(full_prompt))
|
71 |
else:
|
72 |
st.markdown(chain.invoke({'Topic': input_text}))
|