Spaces:
Running
Running
christopher
commited on
Commit
·
7b64b2c
1
Parent(s):
731de2f
Update app.py
Browse files
app.py
CHANGED
@@ -8,20 +8,17 @@ from contextlib import redirect_stdout
|
|
8 |
inputs = st.text_area('The input tensor(s) specified as key-value pairs', placeholder="{'rows': [10, 20, 30],'cols': [1,2,3,4]}")
|
9 |
# The single desired output tensor.
|
10 |
|
11 |
-
st.sidebar.header("
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
gen_kwargs["temperature"] = st.sidebar.slider("Temperature", value = 0.2, min_value = 0.0, max_value=2.0, step=0.05)
|
16 |
-
gen_kwargs["top_k"] = st.sidebar.slider("Top-k", min_value = 0, max_value=100, value = 0)
|
17 |
-
gen_kwargs["top_p"] = st.sidebar.slider("Top-p", min_value = 0.0, max_value=1.0, step = 0.01, value = 0.95)
|
18 |
|
19 |
settings = value_search_settings.from_dict({
|
20 |
'timeout': 300,
|
21 |
'only_minimal_solutions': False,
|
22 |
-
'max_solutions':
|
23 |
-
'require_all_inputs_used':
|
24 |
-
'require_one_input_used':
|
25 |
})
|
26 |
|
27 |
with io.StringIO() as buf, redirect_stdout(buf):
|
|
|
8 |
inputs = st.text_area('The input tensor(s) specified as key-value pairs', placeholder="{'rows': [10, 20, 30],'cols': [1,2,3,4]}")
|
9 |
# The single desired output tensor.
|
10 |
|
11 |
+
st.sidebar.header("Settings:")
|
12 |
+
settings_kwargs = dict()
|
13 |
+
settings_kwargs["require_all_inputs_used"] = st.sidebar.checkbox("Require All")
|
14 |
+
settings_kwargs["max_solutions"] = st.sidebar.slider("Maximum number of solutions", value=1, min_value=1, step=1, max_value=256)
|
|
|
|
|
|
|
15 |
|
16 |
settings = value_search_settings.from_dict({
|
17 |
'timeout': 300,
|
18 |
'only_minimal_solutions': False,
|
19 |
+
'max_solutions': settings_kwargs["max_solutions"],
|
20 |
+
'require_all_inputs_used': settings_kwargs["require_all_inputs_used"],
|
21 |
+
'require_one_input_used': not settings_kwargs["require_all_inputs_used"],
|
22 |
})
|
23 |
|
24 |
with io.StringIO() as buf, redirect_stdout(buf):
|