Spaces:
Sleeping
Sleeping
Fixes
#3
by thesparshsaxena - opened
- .streamlit/config.toml +4 -0
- Homepage.py +0 -32
- docker-entrypoint.sh +3 -1
- repository/Upload_Image.py +2 -2
.streamlit/config.toml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[server]
|
| 2 |
+
enableCORS = false
|
| 3 |
+
enableXsrfProtection = false
|
| 4 |
+
maxUploadSize = 200
|
Homepage.py
CHANGED
|
@@ -6,15 +6,6 @@ PLAN_DIAGRAM = Path("assets/plan.png")
|
|
| 6 |
|
| 7 |
|
| 8 |
def render_homepage() -> None:
|
| 9 |
-
# if not st.user.is_logged_in:
|
| 10 |
-
# st.warning(
|
| 11 |
-
# "Login is required to upload and search your own image library. "
|
| 12 |
-
# "To get test access, raise an issue with your email address and "
|
| 13 |
-
# "access will be enabled within 24 hours."
|
| 14 |
-
# )
|
| 15 |
-
# st.button("Log in with Google", on_click=st.login)
|
| 16 |
-
# else:
|
| 17 |
-
# st.success("You are logged in and can use Upload Image and Search Image.")
|
| 18 |
|
| 19 |
st.title("Visual Recall")
|
| 20 |
st.caption("Private, AI-powered image memory for search, browsing, and retrieval.")
|
|
@@ -190,15 +181,6 @@ background details, and anything else that could help you find the image later.
|
|
| 190 |
"""
|
| 191 |
)
|
| 192 |
|
| 193 |
-
if st.user.is_logged_in:
|
| 194 |
-
st.page_link(
|
| 195 |
-
"repository/Upload_Image.py",
|
| 196 |
-
label="Go to Upload Image",
|
| 197 |
-
icon=":material/upload:",
|
| 198 |
-
)
|
| 199 |
-
else:
|
| 200 |
-
st.info("Log in to open Upload Image.")
|
| 201 |
-
|
| 202 |
with tab_search:
|
| 203 |
st.markdown(
|
| 204 |
"""
|
|
@@ -219,14 +201,6 @@ Search uses two signals together:
|
|
| 219 |
"""
|
| 220 |
)
|
| 221 |
|
| 222 |
-
if st.user.is_logged_in:
|
| 223 |
-
st.page_link(
|
| 224 |
-
"repository/Search_Image.py",
|
| 225 |
-
label="Go to Search Image",
|
| 226 |
-
icon=":material/search:",
|
| 227 |
-
)
|
| 228 |
-
else:
|
| 229 |
-
st.info("Log in to open Search Image.")
|
| 230 |
|
| 231 |
with tab_tips:
|
| 232 |
st.markdown(
|
|
@@ -317,9 +291,3 @@ pages = {"Menu": menu_pages}
|
|
| 317 |
|
| 318 |
pg = st.navigation(pages)
|
| 319 |
pg.run()
|
| 320 |
-
|
| 321 |
-
# if st.user.is_logged_in:
|
| 322 |
-
# with st.sidebar:
|
| 323 |
-
# st.button("Log out", on_click=st.logout)
|
| 324 |
-
# display_name = " ".join(st.user.name.split()[:2])
|
| 325 |
-
# st.write(f"Logged in as: {display_name}\n({st.user.email})")
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def render_homepage() -> None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
st.title("Visual Recall")
|
| 11 |
st.caption("Private, AI-powered image memory for search, browsing, and retrieval.")
|
|
|
|
| 181 |
"""
|
| 182 |
)
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
with tab_search:
|
| 185 |
st.markdown(
|
| 186 |
"""
|
|
|
|
| 201 |
"""
|
| 202 |
)
|
| 203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
with tab_tips:
|
| 206 |
st.markdown(
|
|
|
|
| 291 |
|
| 292 |
pg = st.navigation(pages)
|
| 293 |
pg.run()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker-entrypoint.sh
CHANGED
|
@@ -21,4 +21,6 @@ trap 'kill "$OLLAMA_PID" 2>/dev/null || true' EXIT
|
|
| 21 |
|
| 22 |
exec streamlit run Homepage.py \
|
| 23 |
--server.port=8501 \
|
| 24 |
-
--server.address=0.0.0.0
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
exec streamlit run Homepage.py \
|
| 23 |
--server.port=8501 \
|
| 24 |
+
--server.address=0.0.0.0 \
|
| 25 |
+
--server.enableCORS=false \
|
| 26 |
+
--server.enableXsrfProtection=false
|
repository/Upload_Image.py
CHANGED
|
@@ -27,6 +27,8 @@ if not st.session_state.embedding_boolean:
|
|
| 27 |
pull('embeddinggemma:latest', stream=False)
|
| 28 |
st.session_state.embedding_boolean = True
|
| 29 |
|
|
|
|
|
|
|
| 30 |
uploaded_files = st.file_uploader("Upload your images", accept_multiple_files=True, type=["jpg", "jpeg", "png"], label_visibility="hidden")
|
| 31 |
client = chromadb.PersistentClient(path=f"dbs/{st.session_state.session_id}")
|
| 32 |
db = client.get_or_create_collection(
|
|
@@ -56,8 +58,6 @@ with st.sidebar:
|
|
| 56 |
if st.session_state.LLM_provider == "Ollama":
|
| 57 |
ollama_client = Client(host='https://ollama.com',headers={'Authorization': 'Bearer ' + st.session_state.API_KEY})
|
| 58 |
|
| 59 |
-
st.title("Upload Image")
|
| 60 |
-
|
| 61 |
progress_text = "Operation in progress. Please wait."
|
| 62 |
progress_bar = st.progress(0, text=progress_text)
|
| 63 |
for percent_complete, uploaded_file in enumerate(uploaded_files, start=1):
|
|
|
|
| 27 |
pull('embeddinggemma:latest', stream=False)
|
| 28 |
st.session_state.embedding_boolean = True
|
| 29 |
|
| 30 |
+
st.title("Upload Image")
|
| 31 |
+
|
| 32 |
uploaded_files = st.file_uploader("Upload your images", accept_multiple_files=True, type=["jpg", "jpeg", "png"], label_visibility="hidden")
|
| 33 |
client = chromadb.PersistentClient(path=f"dbs/{st.session_state.session_id}")
|
| 34 |
db = client.get_or_create_collection(
|
|
|
|
| 58 |
if st.session_state.LLM_provider == "Ollama":
|
| 59 |
ollama_client = Client(host='https://ollama.com',headers={'Authorization': 'Bearer ' + st.session_state.API_KEY})
|
| 60 |
|
|
|
|
|
|
|
| 61 |
progress_text = "Operation in progress. Please wait."
|
| 62 |
progress_bar = st.progress(0, text=progress_text)
|
| 63 |
for percent_complete, uploaded_file in enumerate(uploaded_files, start=1):
|