Commit
·
1b1b0cf
1
Parent(s):
04cef8f
MindsEye first attempt
Browse files- .streamlit/config.toml +5 -0
- app.py +0 -0
- disco_streamlit_run.py +0 -0
- hypertron_streamlit_run.py +0 -0
- requirements.txt +15 -0
- streamlit_nested_expanders.py +122 -0
.streamlit/config.toml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[theme]
|
2 |
+
base = "dark"
|
3 |
+
|
4 |
+
[browser]
|
5 |
+
gatherUsageStats = false
|
app.py
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
disco_streamlit_run.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
hypertron_streamlit_run.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
requirements.txt
CHANGED
@@ -1 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
torch
|
|
|
1 |
+
wget
|
2 |
+
fvcore
|
3 |
+
iopath
|
4 |
+
lpips
|
5 |
+
datetime
|
6 |
+
timm
|
7 |
+
ftfy
|
8 |
+
pytorch-lightning
|
9 |
+
omegaconf
|
10 |
+
einops
|
11 |
+
kora
|
12 |
+
imageio
|
13 |
+
kornia
|
14 |
+
pathvalidate
|
15 |
+
-e git+https://github.com/MSFTserver/pytorch3d-lite.git#egg=pytorch3d-lite
|
16 |
torch
|
streamlit_nested_expanders.py
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Optional, Iterable
|
2 |
+
|
3 |
+
import streamlit as st
|
4 |
+
from streamlit import cursor, caching
|
5 |
+
from streamlit import legacy_caching
|
6 |
+
from streamlit import type_util
|
7 |
+
from streamlit import util
|
8 |
+
from streamlit.cursor import Cursor
|
9 |
+
from streamlit.script_run_context import get_script_run_ctx
|
10 |
+
from streamlit.errors import StreamlitAPIException
|
11 |
+
from streamlit.errors import NoSessionContext
|
12 |
+
from streamlit.proto import Block_pb2
|
13 |
+
from streamlit.proto import ForwardMsg_pb2
|
14 |
+
from streamlit.proto.RootContainer_pb2 import RootContainer
|
15 |
+
from streamlit.logger import get_logger
|
16 |
+
|
17 |
+
from streamlit.elements.balloons import BalloonsMixin
|
18 |
+
from streamlit.elements.button import ButtonMixin
|
19 |
+
from streamlit.elements.markdown import MarkdownMixin
|
20 |
+
from streamlit.elements.text import TextMixin
|
21 |
+
from streamlit.elements.alert import AlertMixin
|
22 |
+
from streamlit.elements.json import JsonMixin
|
23 |
+
from streamlit.elements.doc_string import HelpMixin
|
24 |
+
from streamlit.elements.exception import ExceptionMixin
|
25 |
+
from streamlit.elements.bokeh_chart import BokehMixin
|
26 |
+
from streamlit.elements.graphviz_chart import GraphvizMixin
|
27 |
+
from streamlit.elements.plotly_chart import PlotlyMixin
|
28 |
+
from streamlit.elements.deck_gl_json_chart import PydeckMixin
|
29 |
+
from streamlit.elements.map import MapMixin
|
30 |
+
from streamlit.elements.iframe import IframeMixin
|
31 |
+
from streamlit.elements.media import MediaMixin
|
32 |
+
from streamlit.elements.checkbox import CheckboxMixin
|
33 |
+
from streamlit.elements.multiselect import MultiSelectMixin
|
34 |
+
from streamlit.elements.metric import MetricMixin
|
35 |
+
from streamlit.elements.radio import RadioMixin
|
36 |
+
from streamlit.elements.selectbox import SelectboxMixin
|
37 |
+
from streamlit.elements.text_widgets import TextWidgetsMixin
|
38 |
+
from streamlit.elements.time_widgets import TimeWidgetsMixin
|
39 |
+
from streamlit.elements.progress import ProgressMixin
|
40 |
+
from streamlit.elements.empty import EmptyMixin
|
41 |
+
from streamlit.elements.number_input import NumberInputMixin
|
42 |
+
from streamlit.elements.camera_input import CameraInputMixin
|
43 |
+
from streamlit.elements.color_picker import ColorPickerMixin
|
44 |
+
from streamlit.elements.file_uploader import FileUploaderMixin
|
45 |
+
from streamlit.elements.select_slider import SelectSliderMixin
|
46 |
+
from streamlit.elements.slider import SliderMixin
|
47 |
+
from streamlit.elements.snow import SnowMixin
|
48 |
+
from streamlit.elements.image import ImageMixin
|
49 |
+
from streamlit.elements.pyplot import PyplotMixin
|
50 |
+
from streamlit.elements.write import WriteMixin
|
51 |
+
from streamlit.elements.layouts import LayoutsMixin
|
52 |
+
from streamlit.elements.form import FormMixin, FormData, current_form_id
|
53 |
+
from streamlit.state import NoValue
|
54 |
+
|
55 |
+
from streamlit.elements.arrow import ArrowMixin
|
56 |
+
from streamlit.elements.arrow_altair import ArrowAltairMixin
|
57 |
+
from streamlit.elements.arrow_vega_lite import ArrowVegaLiteMixin
|
58 |
+
from streamlit.elements.legacy_data_frame import LegacyDataFrameMixin
|
59 |
+
from streamlit.elements.legacy_altair import LegacyAltairMixin
|
60 |
+
from streamlit.elements.legacy_vega_lite import LegacyVegaLiteMixin
|
61 |
+
from streamlit.elements.dataframe_selector import DataFrameSelectorMixin
|
62 |
+
|
63 |
+
from streamlit.delta_generator import DeltaGenerator
|
64 |
+
|
65 |
+
|
66 |
+
def _block(self, block_proto=Block_pb2.Block()) -> "DeltaGenerator":
|
67 |
+
# Operate on the active DeltaGenerator, in case we're in a `with` block.
|
68 |
+
dg = self._active_dg
|
69 |
+
|
70 |
+
# Prevent nested columns & expanders by checking all parents.
|
71 |
+
block_type = block_proto.WhichOneof("type")
|
72 |
+
# Convert the generator to a list, so we can use it multiple times.
|
73 |
+
parent_block_types = frozenset(dg._parent_block_types)
|
74 |
+
# if block_type == "column" and block_type in parent_block_types:
|
75 |
+
# raise StreamlitAPIException("Columns may not be nested inside other columns.")
|
76 |
+
# if block_type == "expandable" and block_type in parent_block_types:
|
77 |
+
# raise StreamlitAPIException(
|
78 |
+
# "Expanders may not be nested inside other expanders."
|
79 |
+
# )
|
80 |
+
|
81 |
+
if dg._root_container is None or dg._cursor is None:
|
82 |
+
return dg
|
83 |
+
|
84 |
+
msg = ForwardMsg_pb2.ForwardMsg()
|
85 |
+
msg.metadata.delta_path[:] = dg._cursor.delta_path
|
86 |
+
msg.delta.add_block.CopyFrom(block_proto)
|
87 |
+
|
88 |
+
# Normally we'd return a new DeltaGenerator that uses the locked cursor
|
89 |
+
# below. But in this case we want to return a DeltaGenerator that uses
|
90 |
+
# a brand new cursor for this new block we're creating.
|
91 |
+
block_cursor = cursor.RunningCursor(
|
92 |
+
root_container=dg._root_container,
|
93 |
+
parent_path=dg._cursor.parent_path + (dg._cursor.index,),
|
94 |
+
)
|
95 |
+
block_dg = DeltaGenerator(
|
96 |
+
root_container=dg._root_container,
|
97 |
+
cursor=block_cursor,
|
98 |
+
parent=dg,
|
99 |
+
block_type=block_type,
|
100 |
+
)
|
101 |
+
# Blocks inherit their parent form ids.
|
102 |
+
# NOTE: Container form ids aren't set in proto.
|
103 |
+
block_dg._form_data = FormData(current_form_id(dg))
|
104 |
+
|
105 |
+
# Must be called to increment this cursor's index.
|
106 |
+
dg._cursor.get_locked_cursor(last_index=None)
|
107 |
+
_enqueue_message(msg)
|
108 |
+
|
109 |
+
return block_dg
|
110 |
+
|
111 |
+
|
112 |
+
def _enqueue_message(msg):
|
113 |
+
"""Enqueues a ForwardMsg proto to send to the app."""
|
114 |
+
ctx = get_script_run_ctx()
|
115 |
+
|
116 |
+
if ctx is None:
|
117 |
+
raise NoSessionContext()
|
118 |
+
|
119 |
+
ctx.enqueue(msg)
|
120 |
+
|
121 |
+
|
122 |
+
DeltaGenerator._block = _block
|