christopher commited on
Commit
7aa8186
Β·
1 Parent(s): 629e60c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -6,10 +6,11 @@ from contextlib import redirect_stdout
6
  from streamlit_ace import st_ace
7
  st.set_page_config(page_icon='πŸ‘©β€πŸ’»', layout="wide")
8
 
 
 
 
 
9
 
10
- #inputs = st.text_area('The input tensor(s) specified as key-value pairs', placeholder="{'rows': [10, 20, 30],'cols': [1,2,3,4]}")
11
- inputs = st_ace(value="{'rows': [10, 20, 30],\n'cols': [1,2,3,4]}", language="python", theme="solarized_dark")
12
- st.write(type(eval(inputs)))
13
  st.sidebar.header("Settings:")
14
  settings_kwargs = dict()
15
  settings_kwargs["require_all_inputs_used"] = st.sidebar.checkbox("Require All Inputs", value=True)
@@ -26,14 +27,10 @@ settings = value_search_settings.from_dict({
26
  })
27
 
28
  with io.StringIO() as buf, redirect_stdout(buf):
29
- output = [[11, 12, 13, 14],
30
- [21, 22, 23, 24],
31
- [31, 32, 33, 34]]
32
-
33
  constants = []
34
 
35
  description = 'add two vectors with broadcasting to get a matrix'
36
  inputs = {'rows': [10, 20, 30],'cols': [1,2,3,4]}
37
- results = colab_interface.run_value_search_from_colab(inputs, output, constants, description, settings)
38
  stdout = buf.getvalue()
39
  st.code(stdout, language='bash')
 
6
  from streamlit_ace import st_ace
7
  st.set_page_config(page_icon='πŸ‘©β€πŸ’»', layout="wide")
8
 
9
+ st.write('## Inputs')
10
+ inputs = st_ace(placeholder="The input tensor(s) specified as a dictionary", value="{'rows': [10, 20, 30],\n'cols': [1,2,3,4]}", language="python", theme="solarized_dark")
11
+ st.write('## Outputs')
12
+ output = st_ace(placeholder="The output tensor", value="[[11, 12, 13, 14],\n[21, 22, 23, 24],\n[31, 32, 33, 34]]", language="python", theme="solarized_dark")
13
 
 
 
 
14
  st.sidebar.header("Settings:")
15
  settings_kwargs = dict()
16
  settings_kwargs["require_all_inputs_used"] = st.sidebar.checkbox("Require All Inputs", value=True)
 
27
  })
28
 
29
  with io.StringIO() as buf, redirect_stdout(buf):
 
 
 
 
30
  constants = []
31
 
32
  description = 'add two vectors with broadcasting to get a matrix'
33
  inputs = {'rows': [10, 20, 30],'cols': [1,2,3,4]}
34
+ results = colab_interface.run_value_search_from_colab(eval(inputs), eval(output), constants, description, settings)
35
  stdout = buf.getvalue()
36
  st.code(stdout, language='bash')