Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,8 @@ import numpy as np
|
|
| 14 |
|
| 15 |
#st.set_page_config(layout="wide")
|
| 16 |
|
|
|
|
|
|
|
| 17 |
# CSS for styling
|
| 18 |
st.markdown("""
|
| 19 |
<style>
|
|
@@ -30,6 +32,26 @@ st.markdown("""
|
|
| 30 |
}
|
| 31 |
</style>
|
| 32 |
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# Title section
|
| 35 |
st.markdown("<h1 class='title'>E-Commerce Analysis</h1>", unsafe_allow_html=True)
|
|
@@ -78,7 +100,7 @@ examples = [
|
|
| 78 |
|
| 79 |
# Display examples with a button to load them as input
|
| 80 |
for example in examples:
|
| 81 |
-
st.
|
| 82 |
# Set the example text in a temporary session key and submit
|
| 83 |
# st.session_state["example_input"] = example
|
| 84 |
# chat_actions() # Trigger chat as if user entered this example
|
|
@@ -86,7 +108,8 @@ for example in examples:
|
|
| 86 |
with st.chat_message("assistant"):
|
| 87 |
st.write("Hello 👋 How can I help you today?")
|
| 88 |
|
| 89 |
-
st.
|
|
|
|
| 90 |
|
| 91 |
for i in st.session_state["chat_history"]:
|
| 92 |
with st.chat_message(name=i["role"]):
|
|
@@ -103,11 +126,3 @@ for i in st.session_state["chat_history"]:
|
|
| 103 |
st.plotly_chart(i['content']["graph_data"], use_container_width=True)
|
| 104 |
elif (result_df is not None) and ((result_df.shape[0] > 1) and (result_df.shape[1] > 1)) :
|
| 105 |
st.plotly_chart(ff.create_table(result_df), use_container_width=True)
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
| 14 |
|
| 15 |
#st.set_page_config(layout="wide")
|
| 16 |
|
| 17 |
+
st.set_page_config(layout="wide", initial_sidebar_state="collapsed")
|
| 18 |
+
|
| 19 |
# CSS for styling
|
| 20 |
st.markdown("""
|
| 21 |
<style>
|
|
|
|
| 32 |
}
|
| 33 |
</style>
|
| 34 |
""", unsafe_allow_html=True)
|
| 35 |
+
|
| 36 |
+
st.markdown("""
|
| 37 |
+
<style>
|
| 38 |
+
#header {
|
| 39 |
+
visibility: hidden;
|
| 40 |
+
}
|
| 41 |
+
#main-content {
|
| 42 |
+
padding-top: 0;
|
| 43 |
+
}
|
| 44 |
+
</style>
|
| 45 |
+
""", unsafe_allow_html=True)
|
| 46 |
+
|
| 47 |
+
st.markdown("""
|
| 48 |
+
<style>
|
| 49 |
+
.chat-input-container {
|
| 50 |
+
padding-top: 20px;
|
| 51 |
+
padding-bottom: 20px;
|
| 52 |
+
}
|
| 53 |
+
</style>
|
| 54 |
+
""", unsafe_allow_html=True)
|
| 55 |
|
| 56 |
# Title section
|
| 57 |
st.markdown("<h1 class='title'>E-Commerce Analysis</h1>", unsafe_allow_html=True)
|
|
|
|
| 100 |
|
| 101 |
# Display examples with a button to load them as input
|
| 102 |
for example in examples:
|
| 103 |
+
st.label(f"Ask: {example}")
|
| 104 |
# Set the example text in a temporary session key and submit
|
| 105 |
# st.session_state["example_input"] = example
|
| 106 |
# chat_actions() # Trigger chat as if user entered this example
|
|
|
|
| 108 |
with st.chat_message("assistant"):
|
| 109 |
st.write("Hello 👋 How can I help you today?")
|
| 110 |
|
| 111 |
+
with st.container():
|
| 112 |
+
st.chat_input("Enter your question", on_submit=chat_actions, key="chat_input")
|
| 113 |
|
| 114 |
for i in st.session_state["chat_history"]:
|
| 115 |
with st.chat_message(name=i["role"]):
|
|
|
|
| 126 |
st.plotly_chart(i['content']["graph_data"], use_container_width=True)
|
| 127 |
elif (result_df is not None) and ((result_df.shape[0] > 1) and (result_df.shape[1] > 1)) :
|
| 128 |
st.plotly_chart(ff.create_table(result_df), use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|