arcalab commited on
Commit
c7bf23d
·
verified ·
1 Parent(s): 487809e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -69,7 +69,7 @@ def initialize_state() -> None:
69
  st.session_state[key] = value
70
 
71
 
72
- def load_example_values() -> None:
73
  st.session_state.project_name = "Aurora ERP + CRM Modernization"
74
  st.session_state.scope_complexity = "High"
75
  st.session_state.budget = 860000
@@ -335,7 +335,7 @@ def call_gemini(prompt: str, api_key: Optional[str]) -> Optional[str]:
335
  return None
336
  try:
337
  response = requests.post(
338
- f"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key={api_key}",
339
  json={"contents": [{"parts": [{"text": prompt}]}]},
340
  timeout=25,
341
  )
@@ -462,7 +462,7 @@ def render_header() -> None:
462
  )
463
 
464
 
465
- def render_left_panel() -> Tuple[bool, bool]:
466
  st.subheader("Project Inputs")
467
  st.text_input("Project name", key="project_name", placeholder="e.g., Northstar CRM + Data Platform Rollout")
468
  st.selectbox("Scope complexity", options=["Low", "Medium", "High", "Critical"], key="scope_complexity")
@@ -474,10 +474,10 @@ def render_left_panel() -> Tuple[bool, bool]:
474
  st.slider("Dependencies on in-flight projects", min_value=0, max_value=5, step=1, key="dependencies")
475
  c1, c2 = st.columns(2)
476
  with c1:
477
- load_clicked = st.button("Load Example", use_container_width=True)
478
  with c2:
479
  run_clicked = st.button("Run Simulation", type="primary", use_container_width=True)
480
- return load_clicked, run_clicked
481
 
482
 
483
  def render_scenario_tab(result: Dict[str, Any]) -> None:
@@ -568,10 +568,7 @@ def main() -> None:
568
  render_header()
569
  left, right = st.columns([1, 1.7], gap="large")
570
  with left:
571
- load_clicked, run_clicked = render_left_panel()
572
- if load_clicked:
573
- load_example_values()
574
- st.success("Example values loaded.")
575
  if run_clicked:
576
  run_simulation(historical_df)
577
  with right:
 
69
  st.session_state[key] = value
70
 
71
 
72
+ def _load_example_callback() -> None:
73
  st.session_state.project_name = "Aurora ERP + CRM Modernization"
74
  st.session_state.scope_complexity = "High"
75
  st.session_state.budget = 860000
 
335
  return None
336
  try:
337
  response = requests.post(
338
+ f"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key={api_key}",
339
  json={"contents": [{"parts": [{"text": prompt}]}]},
340
  timeout=25,
341
  )
 
462
  )
463
 
464
 
465
+ def render_left_panel() -> bool:
466
  st.subheader("Project Inputs")
467
  st.text_input("Project name", key="project_name", placeholder="e.g., Northstar CRM + Data Platform Rollout")
468
  st.selectbox("Scope complexity", options=["Low", "Medium", "High", "Critical"], key="scope_complexity")
 
474
  st.slider("Dependencies on in-flight projects", min_value=0, max_value=5, step=1, key="dependencies")
475
  c1, c2 = st.columns(2)
476
  with c1:
477
+ st.button("Load Example", use_container_width=True, on_click=_load_example_callback)
478
  with c2:
479
  run_clicked = st.button("Run Simulation", type="primary", use_container_width=True)
480
+ return run_clicked
481
 
482
 
483
  def render_scenario_tab(result: Dict[str, Any]) -> None:
 
568
  render_header()
569
  left, right = st.columns([1, 1.7], gap="large")
570
  with left:
571
+ run_clicked = render_left_panel()
 
 
 
572
  if run_clicked:
573
  run_simulation(historical_df)
574
  with right: