Skip to content

Commit

Permalink
Some adjustments to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovcmedeiros committed Feb 29, 2024
1 parent a932118 commit f1c6ee0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
3 changes: 0 additions & 3 deletions pyrobbot/app/.streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
[server]
runOnSave = true

[client]
showErrorDetails = true

[theme]
base = "light"
# Colors
Expand Down
15 changes: 7 additions & 8 deletions pyrobbot/app/app_page_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,14 @@ def _render_chatbot_page(self): # noqa: PLR0915
question_answer_chunks_queue = queue.Queue()
partial_audios_queue = queue.Queue()

with st.container(height=75, border=False):
with st.container(height=70, border=False):
title_container = st.empty()
with st.container(height=55, border=False):
with st.container(height=35, border=False):
left, _ = st.columns([0.7, 0.3])
with left:
status_msg_container = st.empty()
title_container.header(self.title, divider="rainbow")

title_container.subheader(self.title, divider="rainbow")
chat_msgs_container = st.container(height=600, border=False)
with chat_msgs_container:
self.render_chat_history()
Expand Down Expand Up @@ -537,8 +538,7 @@ def render(self):
"""Render the app's chatbot or costs page, depending on user choice."""

def _trim_page_padding():
st.markdown(
"""
md = """
<style>
.block-container {
padding-top: 0rem;
Expand All @@ -547,9 +547,8 @@ def _trim_page_padding():
padding-right: 5rem;
}
</style>
""",
unsafe_allow_html=True,
)
"""
st.markdown(md, unsafe_allow_html=True)

_trim_page_padding()
if st.session_state.get("toggle_show_costs"):
Expand Down
6 changes: 3 additions & 3 deletions pyrobbot/app/multipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
reply_ongoing = threading.Event()


@st.cache_resource
@st.cache_resource(show_spinner="Initialising listening engine...")
def listen(): # noqa: PLR0912, PLR0915
"""Listen for speech from the browser."""
# This deque will be employed to keep a moving window of audio chunks to monitor
Expand Down Expand Up @@ -171,7 +171,7 @@ def listen(): # noqa: PLR0912, PLR0915
incoming_frame_queue.task_done()


@st.cache_resource
@st.cache_resource(show_spinner="Initialising listening engine...")
def handle_continuous_user_prompt():
"""Play audio."""
logger.debug("Continuous user audio prompt handling thread started")
Expand Down Expand Up @@ -241,7 +241,7 @@ def handle_continuous_user_prompt():
logger.error(error)


@st.cache_resource
@st.cache_resource(show_spinner="Initialising listening engine...")
def handle_stt():
"""Handle speech to text."""
logger.debug("Speech to text handling thread started")
Expand Down

0 comments on commit f1c6ee0

Please sign in to comment.