Spaces:
Running
Running
Merge branch 'main' of https://huggingface.co/spaces/realvest/realvest-app
Browse files- .gitignore +1 -1
- .streamlit/config.toml +4 -0
- app.py +23 -5
.gitignore
CHANGED
@@ -69,7 +69,7 @@ coverage/
|
|
69 |
########################################################################
|
70 |
# Streamlit
|
71 |
########################################################################
|
72 |
-
.streamlit/
|
73 |
lib/streamlit/static
|
74 |
streamlit-storage
|
75 |
|
|
|
69 |
########################################################################
|
70 |
# Streamlit
|
71 |
########################################################################
|
72 |
+
.streamlit/secrets.toml
|
73 |
lib/streamlit/static
|
74 |
streamlit-storage
|
75 |
|
.streamlit/config.toml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[theme]
|
2 |
+
|
3 |
+
# Background color for the main content area
|
4 |
+
backgroundColor = '#FFFFFF'
|
app.py
CHANGED
@@ -128,23 +128,40 @@ def summarize_products(products: list) -> str:
|
|
128 |
# st.set_page_config(layout="centered")
|
129 |
css='''
|
130 |
<style>
|
131 |
-
section.main > div {max-width:
|
|
|
|
|
|
|
132 |
</style>
|
133 |
'''
|
134 |
st.markdown(css, unsafe_allow_html=True)
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
# initialize state
|
137 |
init_session_state()
|
138 |
|
139 |
# Create a text input field
|
140 |
-
|
|
|
|
|
|
|
141 |
|
142 |
# Create a button
|
143 |
-
if st.button('
|
144 |
|
145 |
# # initialize
|
146 |
# st.session_state.clear()
|
147 |
# init_session_state()
|
|
|
|
|
148 |
|
149 |
# ### call OpenAI text-embedding
|
150 |
res = openai.Embedding.create(model=EMBEDDING_MODEL, input=[query], api_key=OPENAI_API_KEY)
|
@@ -250,8 +267,9 @@ if st.session_state['count_checked'] > 0:
|
|
250 |
products.append(
|
251 |
st.session_state['metadata'][pid].get('document')
|
252 |
)
|
253 |
-
|
254 |
-
|
|
|
255 |
else:
|
256 |
try:
|
257 |
summary_container.empty()
|
|
|
128 |
# st.set_page_config(layout="centered")
|
129 |
css='''
|
130 |
<style>
|
131 |
+
section.main > div {max-width:75rem}
|
132 |
+
input[type="text"] {
|
133 |
+
background-color: #F2FEEF !important;
|
134 |
+
}
|
135 |
</style>
|
136 |
'''
|
137 |
st.markdown(css, unsafe_allow_html=True)
|
138 |
|
139 |
+
# remove the hamburger in the upper right hand corner and the Made with Streamlit footer
|
140 |
+
hide_menu_style = """
|
141 |
+
<style>
|
142 |
+
#MainMenu {visibility: hidden;}
|
143 |
+
footer {visibility: hidden;}
|
144 |
+
</style>
|
145 |
+
"""
|
146 |
+
st.markdown(hide_menu_style, unsafe_allow_html=True)
|
147 |
+
|
148 |
# initialize state
|
149 |
init_session_state()
|
150 |
|
151 |
# Create a text input field
|
152 |
+
#st.markdown('Storages, Car Washes, Laundromats... Ask us anything in your own words 🤗 ')
|
153 |
+
#query = st.text_input("")
|
154 |
+
|
155 |
+
query = st.text_input("Storages, Car Washes, Offices, Laundromats... Ask us anything in your own words 🤗 ")
|
156 |
|
157 |
# Create a button
|
158 |
+
if st.button('Search'):
|
159 |
|
160 |
# # initialize
|
161 |
# st.session_state.clear()
|
162 |
# init_session_state()
|
163 |
+
st.session_state['count_checked'] = 0
|
164 |
+
st.session_state['checked_boxes'] = []
|
165 |
|
166 |
# ### call OpenAI text-embedding
|
167 |
res = openai.Embedding.create(model=EMBEDDING_MODEL, input=[query], api_key=OPENAI_API_KEY)
|
|
|
267 |
products.append(
|
268 |
st.session_state['metadata'][pid].get('document')
|
269 |
)
|
270 |
+
with st.spinner('Summarizing...'):
|
271 |
+
summary = summarize_products(products)
|
272 |
+
st.markdown(summary.get("content"), unsafe_allow_html=True)
|
273 |
else:
|
274 |
try:
|
275 |
summary_container.empty()
|