Spaces:
Runtime error
Runtime error
Commit
Β·
f39a294
1
Parent(s):
a0a3cb8
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,15 +6,20 @@ from contextlib import redirect_stdout
|
|
| 6 |
from streamlit_ace import st_ace
|
| 7 |
st.set_page_config(page_icon='π©βπ»', layout="wide", initial_sidebar_state="collapsed")
|
| 8 |
|
| 9 |
-
col1, col2 = st.columns([
|
| 10 |
with col1:
|
| 11 |
st.write('### Inputs')
|
| 12 |
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")
|
| 13 |
with col2:
|
| 14 |
st.write('### Output')
|
| 15 |
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")
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
description = st.text_input(label="Description", placeholder="An optional natural language description of the operation", value="add two vectors with broadcasting to get a matrix")
|
| 19 |
st.sidebar.header("Settings:")
|
| 20 |
settings_kwargs = dict()
|
|
|
|
| 6 |
from streamlit_ace import st_ace
|
| 7 |
st.set_page_config(page_icon='π©βπ»', layout="wide", initial_sidebar_state="collapsed")
|
| 8 |
|
| 9 |
+
col1, col2, col3 = st.columns([5, 5, 3])
|
| 10 |
with col1:
|
| 11 |
st.write('### Inputs')
|
| 12 |
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")
|
| 13 |
with col2:
|
| 14 |
st.write('### Output')
|
| 15 |
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")
|
| 16 |
+
with col3:
|
| 17 |
+
st.write('### Constants')
|
| 18 |
+
constants = st_ace(placeholder="Optional list of scalar constants", value="[]", language="python", theme="solarized_dark")
|
| 19 |
+
if any(inputs, output, constants):
|
| 20 |
+
i = eval(inputs)
|
| 21 |
+
o = eval(output)
|
| 22 |
+
c = eval(constants)
|
| 23 |
description = st.text_input(label="Description", placeholder="An optional natural language description of the operation", value="add two vectors with broadcasting to get a matrix")
|
| 24 |
st.sidebar.header("Settings:")
|
| 25 |
settings_kwargs = dict()
|