Commit
·
2eb58d1
1
Parent(s):
adaa686
Update with Gradio for MindsEye Lite
Browse files- .streamlit/config.toml +0 -5
- README.md +2 -4
- app.py +0 -0
- disco_streamlit_run.py +0 -0
- hypertron_streamlit_run.py +0 -0
- packages.txt +0 -1
- requirements.txt +0 -17
- streamlit_nested_expanders.py +0 -71
.streamlit/config.toml
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
[theme]
|
| 2 |
-
base = "dark"
|
| 3 |
-
|
| 4 |
-
[browser]
|
| 5 |
-
gatherUsageStats = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -3,11 +3,9 @@ title: MindsEye
|
|
| 3 |
emoji: 💻
|
| 4 |
colorFrom: pink
|
| 5 |
colorTo: yellow
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
-
|
| 13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
|
|
|
| 3 |
emoji: 💻
|
| 4 |
colorFrom: pink
|
| 5 |
colorTo: yellow
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 2.9.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
|
|
|
|
|
app.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
disco_streamlit_run.py
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hypertron_streamlit_run.py
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
packages.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
git
|
|
|
|
|
|
requirements.txt
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 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 |
-
torch
|
| 16 |
-
opencv-python
|
| 17 |
-
regex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
streamlit_nested_expanders.py
DELETED
|
@@ -1,71 +0,0 @@
|
|
| 1 |
-
from typing import Optional, Iterable
|
| 2 |
-
|
| 3 |
-
import streamlit as st
|
| 4 |
-
from streamlit import cursor
|
| 5 |
-
from streamlit.report_thread import get_report_ctx as get_script_run_ctx
|
| 6 |
-
#from streamlit.script_run_context import get_script_run_ctx
|
| 7 |
-
from streamlit.errors import NoSessionContext
|
| 8 |
-
from streamlit.proto import Block_pb2
|
| 9 |
-
from streamlit.proto import ForwardMsg_pb2
|
| 10 |
-
|
| 11 |
-
from streamlit.elements.form import FormData, current_form_id
|
| 12 |
-
from streamlit.delta_generator import DeltaGenerator
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
def _block(self, block_proto=Block_pb2.Block()) -> "DeltaGenerator":
|
| 16 |
-
# Operate on the active DeltaGenerator, in case we're in a `with` block.
|
| 17 |
-
dg = self._active_dg
|
| 18 |
-
|
| 19 |
-
# Prevent nested columns & expanders by checking all parents.
|
| 20 |
-
block_type = block_proto.WhichOneof("type")
|
| 21 |
-
# Convert the generator to a list, so we can use it multiple times.
|
| 22 |
-
parent_block_types = frozenset(dg._parent_block_types)
|
| 23 |
-
# if block_type == "column" and block_type in parent_block_types:
|
| 24 |
-
# raise StreamlitAPIException("Columns may not be nested inside other columns.")
|
| 25 |
-
# if block_type == "expandable" and block_type in parent_block_types:
|
| 26 |
-
# raise StreamlitAPIException(
|
| 27 |
-
# "Expanders may not be nested inside other expanders."
|
| 28 |
-
# )
|
| 29 |
-
|
| 30 |
-
if dg._root_container is None or dg._cursor is None:
|
| 31 |
-
return dg
|
| 32 |
-
|
| 33 |
-
msg = ForwardMsg_pb2.ForwardMsg()
|
| 34 |
-
msg.metadata.delta_path[:] = dg._cursor.delta_path
|
| 35 |
-
msg.delta.add_block.CopyFrom(block_proto)
|
| 36 |
-
|
| 37 |
-
# Normally we'd return a new DeltaGenerator that uses the locked cursor
|
| 38 |
-
# below. But in this case we want to return a DeltaGenerator that uses
|
| 39 |
-
# a brand new cursor for this new block we're creating.
|
| 40 |
-
block_cursor = cursor.RunningCursor(
|
| 41 |
-
root_container=dg._root_container,
|
| 42 |
-
parent_path=dg._cursor.parent_path + (dg._cursor.index,),
|
| 43 |
-
)
|
| 44 |
-
block_dg = DeltaGenerator(
|
| 45 |
-
root_container=dg._root_container,
|
| 46 |
-
cursor=block_cursor,
|
| 47 |
-
parent=dg,
|
| 48 |
-
block_type=block_type,
|
| 49 |
-
)
|
| 50 |
-
# Blocks inherit their parent form ids.
|
| 51 |
-
# NOTE: Container form ids aren't set in proto.
|
| 52 |
-
block_dg._form_data = FormData(current_form_id(dg))
|
| 53 |
-
|
| 54 |
-
# Must be called to increment this cursor's index.
|
| 55 |
-
dg._cursor.get_locked_cursor(last_index=None)
|
| 56 |
-
_enqueue_message(msg)
|
| 57 |
-
|
| 58 |
-
return block_dg
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
def _enqueue_message(msg):
|
| 62 |
-
"""Enqueues a ForwardMsg proto to send to the app."""
|
| 63 |
-
ctx = get_script_run_ctx()
|
| 64 |
-
|
| 65 |
-
if ctx is None:
|
| 66 |
-
raise NoSessionContext()
|
| 67 |
-
|
| 68 |
-
ctx.enqueue(msg)
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
DeltaGenerator._block = _block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|