Sigrid De los Santos commited on
Commit
8143a2a
Β·
1 Parent(s): bb235fc

Remove remaining binary file for Hugging Face

Browse files
Files changed (2) hide show
  1. app.py +11 -3
  2. src/main.py +3 -1
app.py CHANGED
@@ -48,15 +48,23 @@ if submitted:
48
  df.to_csv(tmp_csv.name, index=False)
49
  csv_path = tmp_csv.name
50
 
51
- # Live log capture
52
  log_output = st.empty()
53
  string_buffer = StringIO()
54
 
55
- with contextlib.redirect_stdout(string_buffer), st.spinner("πŸ” Running analysis..."):
 
 
 
 
 
56
  output_path = run_pipeline(csv_path, tavily_api_key)
 
57
 
58
  logs = string_buffer.getvalue()
59
- log_output.code(logs)
 
 
60
 
61
  if output_path and isinstance(output_path, list):
62
  st.success("βœ… Analysis complete!")
 
48
  df.to_csv(tmp_csv.name, index=False)
49
  csv_path = tmp_csv.name
50
 
51
+ progress_placeholder = st.empty()
52
  log_output = st.empty()
53
  string_buffer = StringIO()
54
 
55
+ def write_log(msg):
56
+ print(msg) # Will go to final log
57
+ progress_placeholder.markdown(f"πŸ”„ {msg}")
58
+
59
+ with contextlib.redirect_stdout(string_buffer):
60
+ write_log("πŸš€ Starting analysis...")
61
  output_path = run_pipeline(csv_path, tavily_api_key)
62
+ write_log("βœ… Finished analysis.")
63
 
64
  logs = string_buffer.getvalue()
65
+ progress_placeholder.empty() # Clear ephemeral log
66
+ log_output.code(logs) # Show final full log
67
+
68
 
69
  if output_path and isinstance(output_path, list):
70
  st.success("βœ… Analysis complete!")
src/main.py CHANGED
@@ -60,7 +60,9 @@ def run_value_investing_analysis(csv_path):
60
  from image_search import search_unsplash_image
61
 
62
  # Later inside your loop
63
- image_url, image_credit = search_unsplash_image(topic, os.getenv("OPENAI_API_KEY"))
 
 
64
 
65
  metrics_md = build_metrics_box(topic, len(news))
66
  full_md = metrics_md + report_body
 
60
  from image_search import search_unsplash_image
61
 
62
  # Later inside your loop
63
+ image_url, image_credit = search_unsplash_image(topic)
64
+
65
+ #image_url, image_credit = search_unsplash_image(topic, os.getenv("OPENAI_API_KEY"))
66
 
67
  metrics_md = build_metrics_box(topic, len(news))
68
  full_md = metrics_md + report_body