christopher commited on
Commit
7f1aca2
β€’
1 Parent(s): 0ce2fd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,6 +1,9 @@
1
  import streamlit as st
2
  from tf_coder.value_search import colab_interface
3
  from tf_coder.value_search import value_search_settings
 
 
 
4
  def get_problem():
5
  """Specifies a problem to run TF-Coder on. Edit this function!"""
6
  # A dict mapping input variable names to input tensors.
@@ -32,7 +35,7 @@ settings = value_search_settings.from_dict({
32
 
33
  i = st.text_area("input tensor","second test")
34
 
35
- inputs, output, constants, description = get_problem()
36
- t = colab_interface.run_value_search_from_colab(inputs, output, constants, description, settings)
37
- for e in ["benchmark", "count", "index", "settings", "solutions", "statistics", "total_time", "value_set", "values_by_weight"]:
38
- st.write(eval(f"t.{e}"))
 
1
  import streamlit as st
2
  from tf_coder.value_search import colab_interface
3
  from tf_coder.value_search import value_search_settings
4
+ import io
5
+ from contextlib import redirect_stdout
6
+
7
  def get_problem():
8
  """Specifies a problem to run TF-Coder on. Edit this function!"""
9
  # A dict mapping input variable names to input tensors.
 
35
 
36
  i = st.text_area("input tensor","second test")
37
 
38
+ with io.StringIO() as buf, redirect_stdout(buf):
39
+ colab_interface.run_value_search_from_colab(inputs, output, constants, description, settings)
40
+ output = buf.getvalue()
41
+ st.write(output)