Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,22 +10,6 @@ from langchain.chains import ConversationalRetrievalChain
|
|
| 10 |
DB_FAISS_PATH = 'vectorstore/db_faiss'
|
| 11 |
background_image_path = 'image1.jpg'
|
| 12 |
# Set the background image and color
|
| 13 |
-
st.markdown(
|
| 14 |
-
"""
|
| 15 |
-
<style>
|
| 16 |
-
body {
|
| 17 |
-
background-image: url('file://%s');
|
| 18 |
-
background-size: cover;
|
| 19 |
-
background-color: #00FF00; /* Dodger Blue */
|
| 20 |
-
color: blue;
|
| 21 |
-
}
|
| 22 |
-
.st-bw {
|
| 23 |
-
color: white;
|
| 24 |
-
}
|
| 25 |
-
</style>
|
| 26 |
-
""",
|
| 27 |
-
unsafe_allow_html=True
|
| 28 |
-
)
|
| 29 |
|
| 30 |
#Loading the model
|
| 31 |
def load_llm():
|
|
@@ -39,22 +23,7 @@ st.markdown("<h3 style='text-align: center; color: white;'>Built by <a href=http
|
|
| 39 |
#background_image_url = 'https://www.bing.com/images/search?view=detailV2&ccid=lFAWXtbv&id=BB57AC3541361FF3844CAA706B667014CB515B92&thid=OIP.lFAWXtbvpchf66BryfJQ1QHaE8&mediaurl=https%3a%2f%2fimage.freepik.com%2ffree-photo%2ftwo-llamas-andean-highland-bolivia_107467-2006.jpg&exph=418&expw=626&q=llama2+image&simid=608011097331751957&FORM=IRPRST&ck=F66D65F1AFAAA4BBCF9986ADF8ED1643&selectedIndex=4'
|
| 40 |
background_image_path = 'image1.jpg'
|
| 41 |
# Set the background image and color
|
| 42 |
-
|
| 43 |
-
"""
|
| 44 |
-
<style>
|
| 45 |
-
body {
|
| 46 |
-
background-image: url('file://%s');
|
| 47 |
-
background-size: cover;
|
| 48 |
-
background-color: #00FF00; /* Dodger Blue */
|
| 49 |
-
color: white;
|
| 50 |
-
}
|
| 51 |
-
.st-bw {
|
| 52 |
-
color: blue;
|
| 53 |
-
}
|
| 54 |
-
</style>
|
| 55 |
-
""" % background_image_path.replace("\\", "/"),
|
| 56 |
-
unsafe_allow_html=True
|
| 57 |
-
)
|
| 58 |
|
| 59 |
uploaded_file = st.sidebar.file_uploader("Upload your Data", type="csv")
|
| 60 |
|
|
@@ -84,7 +53,7 @@ if uploaded_file :
|
|
| 84 |
st.session_state['history'] = []
|
| 85 |
|
| 86 |
if 'generated' not in st.session_state:
|
| 87 |
-
st.session_state['generated'] = ["Hello !
|
| 88 |
|
| 89 |
if 'past' not in st.session_state:
|
| 90 |
st.session_state['past'] = ["Hey ! 👋"]
|
|
@@ -97,7 +66,7 @@ if uploaded_file :
|
|
| 97 |
with container:
|
| 98 |
with st.form(key='my_form', clear_on_submit=True):
|
| 99 |
|
| 100 |
-
user_input = st.text_input("Query:", placeholder="
|
| 101 |
submit_button = st.form_submit_button(label='Send')
|
| 102 |
|
| 103 |
if submit_button and user_input:
|
|
|
|
| 10 |
DB_FAISS_PATH = 'vectorstore/db_faiss'
|
| 11 |
background_image_path = 'image1.jpg'
|
| 12 |
# Set the background image and color
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
#Loading the model
|
| 15 |
def load_llm():
|
|
|
|
| 23 |
#background_image_url = 'https://www.bing.com/images/search?view=detailV2&ccid=lFAWXtbv&id=BB57AC3541361FF3844CAA706B667014CB515B92&thid=OIP.lFAWXtbvpchf66BryfJQ1QHaE8&mediaurl=https%3a%2f%2fimage.freepik.com%2ffree-photo%2ftwo-llamas-andean-highland-bolivia_107467-2006.jpg&exph=418&expw=626&q=llama2+image&simid=608011097331751957&FORM=IRPRST&ck=F66D65F1AFAAA4BBCF9986ADF8ED1643&selectedIndex=4'
|
| 24 |
background_image_path = 'image1.jpg'
|
| 25 |
# Set the background image and color
|
| 26 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
uploaded_file = st.sidebar.file_uploader("Upload your Data", type="csv")
|
| 29 |
|
|
|
|
| 53 |
st.session_state['history'] = []
|
| 54 |
|
| 55 |
if 'generated' not in st.session_state:
|
| 56 |
+
st.session_state['generated'] = ["Hello ! What is your query about " + uploaded_file.name + " 🤗"]
|
| 57 |
|
| 58 |
if 'past' not in st.session_state:
|
| 59 |
st.session_state['past'] = ["Hey ! 👋"]
|
|
|
|
| 66 |
with container:
|
| 67 |
with st.form(key='my_form', clear_on_submit=True):
|
| 68 |
|
| 69 |
+
user_input = st.text_input("Query:", placeholder="Search answer from your csv data here (:", key='input')
|
| 70 |
submit_button = st.form_submit_button(label='Send')
|
| 71 |
|
| 72 |
if submit_button and user_input:
|