File size: 1,586 Bytes
5bcc73a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b6b196e
5bcc73a
 
 
 
 
 
 
 
 
67bc9b1
 
 
965645e
 
 
5bcc73a
 
 
 
b6b196e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5bcc73a
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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  # noqa E402
from search import write_grascii_search, write_reverse_search, write_dictionaries  # noqa E402

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 "alternatives" not in st.session_state:
    st.session_state["alternatives"] = {}

if "save_image" in st.session_state:
    st.session_state["save_image"] = st.session_state["save_image"]

if st.session_state["report_submitted"]:
    st.toast("Thanks for the report!")
    st.session_state["report_submitted"] = False

with st.sidebar:
    st.markdown(
        """
        # What's New

        :blue-badge[2025-07-15]

        - The preanniversary-phrases dictionary is now available!
        - You may select which dictionaries you would like to search.
        - To see which dictionary contained each result, hover over the result
          table. Click the "eye" icon at the top right of the table and
          select "Dictionary".
        """
    )

write_dictionaries()

tab1, tab2 = st.tabs(["Grascii", "Reverse"])

with tab1:
    write_grascii_search()

with tab2:
    write_reverse_search()