Spaces:
Runtime error
Runtime error
Commit
·
9c6fc15
1
Parent(s):
b743e81
Test #A
Browse files
app.py
CHANGED
@@ -1,11 +1,15 @@
|
|
1 |
-
conda create -n env_pytorch python=3.6
|
2 |
import streamlit as st
|
3 |
-
conda activate env_pytorch
|
4 |
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
9 |
|
10 |
@st.cache(allow_output_mutation=True)
|
11 |
def load_tileset():
|
|
|
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
+
@st.cache
|
4 |
+
def load_model():
|
5 |
+
model = Megatron()
|
6 |
+
return model
|
7 |
|
8 |
+
@st.cache(allow_output_mutation=True) # this line is important!
|
9 |
+
def generate_tileset(model, seed):
|
10 |
+
tileset = model.generate_tileset(seed) # this will take some time to run the first time, but will be cached thereafter
|
11 |
+
|
12 |
+
return tileset
|
13 |
|
14 |
@st.cache(allow_output_mutation=True)
|
15 |
def load_tileset():
|