|
import streamlit as st |
|
|
|
st.set_page_config( |
|
page_title="Grascii Search", |
|
menu_items={ |
|
"About": """ |
|
Web interface for [grascii](https://github.com/grascii/grascii)'s |
|
search utility |
|
|
|
Image search powered by [gregg-vision-v0.2.1](https://huggingface.co/grascii/gregg-vision-v0.2.1) |
|
""" |
|
}, |
|
) |
|
|
|
import pandas as pd |
|
from search import write_grascii_search, write_reverse_search |
|
|
|
pd.options.mode.copy_on_write = True |
|
|
|
if "report_submitted" not in st.session_state: |
|
st.session_state["report_submitted"] = False |
|
|
|
if "grascii" not in st.session_state: |
|
st.session_state["grascii"] = "" |
|
|
|
if st.session_state["report_submitted"]: |
|
st.toast("Thanks for the report!") |
|
st.session_state["report_submitted"] = False |
|
|
|
tab1, tab2 = st.tabs(["Grascii", "Reverse"]) |
|
|
|
with tab1: |
|
write_grascii_search() |
|
|
|
with tab2: |
|
write_reverse_search() |
|
|