File size: 762 Bytes
597bf7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
from pip._internal.operations import freeze

from subpages.page import Context, Page


class DebugPage(Page):
    name = "Debug"
    icon = "bug"

    def render(self, context: Context):
        st.title(self.name)
        # with st.expander("💡", expanded=True):
        #     st.write("Some debug info.")

        st.subheader("Installed Packages")
        # get output of pip freeze from system
        with st.expander("pip freeze"):
            st.code("\n".join(freeze.freeze()))

        st.subheader("Streamlit Session State")
        st.json(st.session_state)
        st.subheader("Tokenizer")
        st.code(context.tokenizer)
        st.subheader("Model")
        st.code(context.model.config)
        st.code(context.model)