Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
lasyaEd committed Dec 12, 2024
1 parent fe56404 commit 5f4edb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
with open(metadata_path, "w") as f:
json.dump([], f)


def load_metadata(metadata_path=metadata_path):
"""
Loads metadata from the specified JSON file.
Expand All @@ -79,12 +80,14 @@ def load_metadata(metadata_path=metadata_path):
print(f"Metadata handling error: {str(e)}")
return []


def get_base64_image(image_path):
import base64

with open(image_path, "rb") as img_file:
return base64.b64encode(img_file.read()).decode()


col1, col2 = st.columns([4, 1])
with col2:
st.markdown(
Expand Down Expand Up @@ -278,7 +281,9 @@ def get_base64_image(image_path):
Maintain a conversational and approachable tone. Always aim to provide clear, concise, and accurate answers."""

# Accept user input
if prompt := st.chat_input("What would you like to know?", disabled=st.session_state.api_key == ""):
if prompt := st.chat_input(
"What would you like to know?", disabled=st.session_state.api_key == ""
):
# Add user message to chat history
st.session_state.messages.append({"role": "user", "content": prompt})
with st.chat_message("user"):
Expand Down

0 comments on commit 5f4edb7

Please sign in to comment.