Tuana commited on
Commit
51d2865
β€’
1 Parent(s): 3dcb9ed

adding an informative sidebar

Browse files
.streamlit/config.toml CHANGED
@@ -1,7 +1,3 @@
1
  [theme]
2
- primaryColor="#1C9BEF"
3
- base = "dark"
4
- backgroundColor="#2B2F54"
5
- secondaryBackgroundColor="#01AE9D"
6
- textColor="#D8D8E5"
7
  font="monospace"
 
1
  [theme]
2
+ base = "light"
 
 
 
 
3
  font="monospace"
app.py CHANGED
@@ -7,15 +7,11 @@ from markdown import markdown
7
  import streamlit as st
8
 
9
  from utils.haystack import query
10
- from utils.ui import reset_results, set_initial_state
11
 
12
  set_initial_state()
13
 
14
- st.markdown("Thanks for coming to this πŸ€— Spcae.\n **A few words of warning**:\n\n"
15
- "This is very much a project for fun, and is not a final product."
16
- "There's a lot that can be improved to make this app better...\n\n"
17
- "**Please take results with a grain of** πŸ§‚\n\n"
18
- "For more on how this was built, instructions to run locally and to contribute: [visit GitHub](https://github.com/TuanaCelik/should-i-follow#readme)")
19
 
20
  st.write("# 🐀 What have they been tweeting about lately?")
21
 
 
7
  import streamlit as st
8
 
9
  from utils.haystack import query
10
+ from utils.ui import reset_results, set_initial_state, sidebar
11
 
12
  set_initial_state()
13
 
14
+ sidebar()
 
 
 
 
15
 
16
  st.write("# 🐀 What have they been tweeting about lately?")
17
 
logo/haystack-logo-colored.png ADDED
utils/ui.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
 
3
  def set_state_if_absent(key, value):
4
  if key not in st.session_state:
@@ -10,3 +11,23 @@ def set_initial_state():
10
 
11
  def reset_results(*args):
12
  st.session_state.result = None
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from PIL import Image
3
 
4
  def set_state_if_absent(key, value):
5
  if key not in st.session_state:
 
11
 
12
  def reset_results(*args):
13
  st.session_state.result = None
14
+
15
+ def sidebar():
16
+ with st.sidebar:
17
+ image = Image.open('logo/haystack-logo-colored.png')
18
+ st.markdown("Thanks for coming to this πŸ€— Spcae.\n\n"
19
+ "This is a project for fun, and is not a final product."
20
+ "There's a lot that can be improved to make this app better.\n\n"
21
+ "**Take results with a grain of** πŸ§‚\n\n"
22
+ "For more on how this was built, instructions to run locally and to contribute: [visit GitHub](https://github.com/TuanaCelik/should-i-follow#readme)")
23
+
24
+ st.markdown(
25
+ "## How this works\n"
26
+ "This app was built with [Haystack](https://haystack.deepset.ai) using the"
27
+ " [`PromptNode`](https://docs.haystack.deepset.ai/docs/prompt_node) and custom [`PromptTemplate`](https://docs.haystack.deepset.ai/docs/prompt_node#templates).\n\n"
28
+ " The source code is also on [GitHub](https://github.com/TuanaCelik/should-i-follow)"
29
+ " with instructions to run locally.\n"
30
+ "You can see how the `PromptNode` was set up [here](https://github.com/TuanaCelik/should-i-follow/blob/main/utils/haystack.py)")
31
+ st.markdown("---")
32
+ st.markdown("Made by [tuanacelik](https://twitter.com/tuanacelik)")
33
+ st.image(image, width=250)