Spaces:
Runtime error
Runtime error
Commit
·
910bf72
1
Parent(s):
75261b1
actually draw
Browse files
app.py
CHANGED
@@ -22,7 +22,9 @@ DIFFUSION_DEFAULTS = dict(
|
|
22 |
@st.experimental_singleton
|
23 |
def setup():
|
24 |
import os, subprocess, sys
|
25 |
-
|
|
|
|
|
26 |
os.system("pip install tokenizers x-transformers==0.22.0 axial-positional-embedding")
|
27 |
os.system("pip install einops==0.3.2")
|
28 |
sys.path.append("improved-diffusion")
|
@@ -78,8 +80,13 @@ def handler(text, ts1, ts2, gs1):
|
|
78 |
text = st.text_area('asdf')
|
79 |
|
80 |
if st.button('rweerew'):
|
|
|
|
|
|
|
81 |
for s, xs in handler(text, 20, 20, 0):
|
82 |
-
|
|
|
|
|
83 |
|
84 |
# x = st.slider('Select a value')
|
85 |
# st.write(x, 'squared is', x * x)
|
|
|
22 |
@st.experimental_singleton
|
23 |
def setup():
|
24 |
import os, subprocess, sys
|
25 |
+
if not os.path.exists('improved_diffusion'):
|
26 |
+
os.system("git clone https://github.com/nostalgebraist/improved-diffusion.git")
|
27 |
+
os.system("cd improved-diffusion && git fetch origin nbar-space && git checkout nbar-space && pip install -e .")
|
28 |
os.system("pip install tokenizers x-transformers==0.22.0 axial-positional-embedding")
|
29 |
os.system("pip install einops==0.3.2")
|
30 |
sys.path.append("improved-diffusion")
|
|
|
80 |
text = st.text_area('asdf')
|
81 |
|
82 |
if st.button('rweerew'):
|
83 |
+
low_res = st.empty()
|
84 |
+
high_res = st.empty()
|
85 |
+
|
86 |
for s, xs in handler(text, 20, 20, 0):
|
87 |
+
target = low_res if s.size[0] < 256 else high_res
|
88 |
+
with target.container():
|
89 |
+
st.write([s, xs])
|
90 |
|
91 |
# x = st.slider('Select a value')
|
92 |
# st.write(x, 'squared is', x * x)
|