cheesyFishes commited on
Commit
a71e0a3
1 Parent(s): ea3dcd5

Improve demo app

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -18,12 +18,12 @@ st.markdown("This demo uses the [llama-agi](https://github.com/run-llama/llama-l
18
  setup_tab, launch_tab = st.tabs(["Setup", "Launch"])
19
 
20
  with setup_tab:
21
- st.subheader("LLM Setup")
22
- col1, col2, col3 = st.columns(3)
23
-
24
  if 'init' in st.session_state:
25
  st.success("Initialized!")
26
 
 
 
 
27
  with col1:
28
  openai_api_key = st.text_input("Enter your OpenAI API key here", type="password")
29
  llm_name = st.selectbox(
@@ -45,7 +45,7 @@ with setup_tab:
45
  st.subheader("AGI Setup")
46
  objective = st.text_input("Objective:", value="Solve world hunger")
47
  initial_task = st.text_input("Initial Task:", value="Create a list of tasks")
48
- max_iterations = st.slider("Iterations until pause", value=2, min_value=1, max_value=100, step=5)
49
 
50
  if st.button('Initialize?'):
51
  os.environ['OPENAI_API_KEY'] = openai_api_key
@@ -77,10 +77,11 @@ with setup_tab:
77
  st.session_state['objective'] = objective
78
 
79
  st.session_state['init'] = True
 
80
 
81
  with launch_tab:
82
  st.subheader("AGI Status")
83
- if st.button("Launch"):
84
  if st.session_state.get('init', False):
85
  # launch the auto runner
86
  with st.spinner("Running!"):
 
18
  setup_tab, launch_tab = st.tabs(["Setup", "Launch"])
19
 
20
  with setup_tab:
 
 
 
21
  if 'init' in st.session_state:
22
  st.success("Initialized!")
23
 
24
+ st.subheader("LLM Setup")
25
+ col1, col2, col3 = st.columns(3)
26
+
27
  with col1:
28
  openai_api_key = st.text_input("Enter your OpenAI API key here", type="password")
29
  llm_name = st.selectbox(
 
45
  st.subheader("AGI Setup")
46
  objective = st.text_input("Objective:", value="Solve world hunger")
47
  initial_task = st.text_input("Initial Task:", value="Create a list of tasks")
48
+ max_iterations = st.slider("Iterations until pause", value=1, min_value=1, max_value=10, step=1)
49
 
50
  if st.button('Initialize?'):
51
  os.environ['OPENAI_API_KEY'] = openai_api_key
 
77
  st.session_state['objective'] = objective
78
 
79
  st.session_state['init'] = True
80
+ st.experimental_rerun()
81
 
82
  with launch_tab:
83
  st.subheader("AGI Status")
84
+ if st.button(f"Continue for {max_iterations} Steps"):
85
  if st.session_state.get('init', False):
86
  # launch the auto runner
87
  with st.spinner("Running!"):