Skip to content

Commit

Permalink
Add data model image to loader page
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarhane committed Sep 28, 2023
1 parent c2cf59e commit 075680b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*
!*.py
!requirements.txt
!images/*
Binary file added images/datamodel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions loader.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO Langchain base image
FROM python:latest

WORKDIR /app
Expand All @@ -13,9 +12,9 @@ COPY requirements.txt .

RUN pip install --upgrade -r requirements.txt

# COPY .env .
COPY loader.py .
COPY utils.py .
COPY images ./images

EXPOSE 8502

Expand Down
7 changes: 6 additions & 1 deletion loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import streamlit as st
from streamlit.logger import get_logger
from utils import load_embedding_model
from PIL import Image

load_dotenv(".env")

Expand Down Expand Up @@ -142,9 +143,10 @@ def get_pages():


def render_page():
datamodel_image = Image.open("./images/datamodel.png")
st.header("StackOverflow Loader")
st.subheader("Choose StackOverflow tags to load into Neo4j")
st.caption("Go to http://localhost:7474/browser/ to explore the graph.")
st.caption("Go to http://localhost:7474/ to explore the graph.")

user_input = get_tag()
num_pages, start_page = get_pages()
Expand All @@ -155,6 +157,9 @@ def render_page():
for page in range(1, num_pages + 1):
load_so_data(user_input, start_page + (page - 1))
st.success("Import successful", icon="✅")
st.caption("Data model")
st.image(datamodel_image)
st.caption("Go to http://localhost:7474/ to interact with the database")
except Exception as e:
st.error(f"Error: {e}", icon="🚨")
with st.expander("Highly ranked questions rather than tags?"):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tiktoken
neo4j
streamlit
sentence_transformers
Pillow

0 comments on commit 075680b

Please sign in to comment.