christopher commited on
Commit
731de2f
·
1 Parent(s): b2c9745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -5,12 +5,17 @@ from tf_coder.value_search import value_search_settings
5
  import io
6
  from contextlib import redirect_stdout
7
 
8
- inputs = st.text_area('The input tensor(s) specified as key-value pairs', placeholder='''
9
- {'rows': [10, 20, 30],
10
- 'cols': [1,2,3,4],}
11
- ''')
12
  # The single desired output tensor.
13
 
 
 
 
 
 
 
 
 
14
  settings = value_search_settings.from_dict({
15
  'timeout': 300,
16
  'only_minimal_solutions': False,
 
5
  import io
6
  from contextlib import redirect_stdout
7
 
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("Generation settings:")
12
+ gen_kwargs["do_sample"] = st.sidebar.radio("Decoding strategy", ["Require All", "Require One"]) == "Require All"
13
+ gen_kwargs["max_new_tokens"] = st.sidebar.slider("Number of tokens to generate", value=default_length, min_value=8, step=8, max_value=256)
14
+ if gen_kwargs["do_sample"]:
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,