SusiePHaltmann commited on
Commit
9c6fc15
·
1 Parent(s): b743e81
Files changed (1) hide show
  1. app.py +9 -5
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
- import streamlit as st
7
- from PIL import Image
8
- import numpy as np
 
 
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():