Spaces:
Sleeping
Sleeping
Sandaruth
commited on
Commit
•
c1f0bbe
1
Parent(s):
4761e32
version2
Browse files
app.py
CHANGED
@@ -14,16 +14,16 @@ def main():
|
|
14 |
|
15 |
# Button to connect to Google link ------------------------------------------------
|
16 |
|
17 |
-
st.sidebar.markdown('<a href="https://
|
18 |
'background-color: none; color: white; padding: 10px 20px; text-align: center;border: 1px solid white;'
|
19 |
-
'text-decoration: none; cursor: pointer; border-radius: 5px;">
|
20 |
unsafe_allow_html=True)
|
21 |
|
22 |
st.title("ATrad Chat App")
|
23 |
|
24 |
# Chat area -----------------------------------------------------------------------
|
25 |
|
26 |
-
user_input = st.text_input("
|
27 |
# JavaScript code to submit the form on Enter key press
|
28 |
js_submit = f"""
|
29 |
document.addEventListener("keydown", function(event) {{
|
|
|
14 |
|
15 |
# Button to connect to Google link ------------------------------------------------
|
16 |
|
17 |
+
st.sidebar.markdown('<a href="https://drive.google.com/drive/u/0/folders/1fK6vuAWy9cLuI3YH3V7vnSB7LVsPa4pi" target="_blank" style="display: inline-block;'
|
18 |
'background-color: none; color: white; padding: 10px 20px; text-align: center;border: 1px solid white;'
|
19 |
+
'text-decoration: none; cursor: pointer; border-radius: 5px;">Sources</a>',
|
20 |
unsafe_allow_html=True)
|
21 |
|
22 |
st.title("ATrad Chat App")
|
23 |
|
24 |
# Chat area -----------------------------------------------------------------------
|
25 |
|
26 |
+
user_input = st.text_input("", key="user_input")
|
27 |
# JavaScript code to submit the form on Enter key press
|
28 |
js_submit = f"""
|
29 |
document.addEventListener("keydown", function(event) {{
|
model.py
CHANGED
@@ -55,6 +55,7 @@ from langchain_community.vectorstores import FAISS
|
|
55 |
|
56 |
persits_directory="./faiss_Test02_500_C_BGE_large"
|
57 |
# persits_directory="./faiss_V03_C500_BGE_large-final"
|
|
|
58 |
|
59 |
vectorstore= FAISS.load_local(persits_directory, embedding)
|
60 |
|
@@ -92,6 +93,9 @@ qa_template2 = ("""
|
|
92 |
Please provide me with any questions or concerns you have regarding the ATrad Application.
|
93 |
If you're unsure about something or need more information, feel free to ask.
|
94 |
|
|
|
|
|
|
|
95 |
each answer Must start with code word ATrad Ai(QA):
|
96 |
|
97 |
Question: {question}
|
@@ -99,7 +103,7 @@ qa_template2 = ("""
|
|
99 |
ATrad Ai(QA): Let me think about it...""")
|
100 |
|
101 |
|
102 |
-
QA_PROMPT = PromptTemplate(input_variables=["context", "question"],template=
|
103 |
|
104 |
|
105 |
# Chain for Web
|
|
|
55 |
|
56 |
persits_directory="./faiss_Test02_500_C_BGE_large"
|
57 |
# persits_directory="./faiss_V03_C500_BGE_large-final"
|
58 |
+
# persits_directory="./faiss_V03_C1000_BGE_large-final"
|
59 |
|
60 |
vectorstore= FAISS.load_local(persits_directory, embedding)
|
61 |
|
|
|
93 |
Please provide me with any questions or concerns you have regarding the ATrad Application.
|
94 |
If you're unsure about something or need more information, feel free to ask.
|
95 |
|
96 |
+
Important:-No need to mention provided document. give strictly answers.
|
97 |
+
-Give answers in a very structured manner to understand easily.
|
98 |
+
|
99 |
each answer Must start with code word ATrad Ai(QA):
|
100 |
|
101 |
Question: {question}
|
|
|
103 |
ATrad Ai(QA): Let me think about it...""")
|
104 |
|
105 |
|
106 |
+
QA_PROMPT = PromptTemplate(input_variables=["context", "question"],template=qa_template2,)
|
107 |
|
108 |
|
109 |
# Chain for Web
|