aadisawant2912 commited on
Commit
622feba
·
verified ·
1 Parent(s): 0303e7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -124,7 +124,7 @@ def _count_papers_per_topic(run_config: str) -> dict:
124
  return {s["topic_id"]: 0 for s in summaries}
125
 
126
  sent_to_paper = {}
127
- for idx, text in enumerate(papers_df[text_col].fillna("").tolist()):
128
  for sent in str(text).split("."):
129
  key = sent.strip()[:80]
130
  if key:
@@ -224,7 +224,7 @@ def handle_file_upload(file_path) -> str:
224
  try:
225
  df = _safe_read_csv(dest)
226
  msg = "CSV saved ({} rows, {} columns: {}). ".format(
227
- len(df), len(df.columns), ", ".join(df.columns[:6].tolist())
228
  )
229
  except Exception:
230
  msg = "CSV saved to {}. ".format(dest)
@@ -343,7 +343,7 @@ def handle_submit_review(review_data, history: list, thread_id: str, run_config:
343
  def to_bool(v):
344
  return v is True or str(v).strip().lower() in ("true","1","yes","x","on","✓")
345
 
346
- approved_df = df[pd.Series(list(map(to_bool, df[approve_col].tolist())), index=df.index)]
347
 
348
  if len(approved_df) == 0:
349
  guide = (
 
124
  return {s["topic_id"]: 0 for s in summaries}
125
 
126
  sent_to_paper = {}
127
+ for idx, text in enumerate(list(papers_df[text_col].fillna(""))):
128
  for sent in str(text).split("."):
129
  key = sent.strip()[:80]
130
  if key:
 
224
  try:
225
  df = _safe_read_csv(dest)
226
  msg = "CSV saved ({} rows, {} columns: {}). ".format(
227
+ len(df), len(df.columns), ", ".join(list(df.columns[:6]))
228
  )
229
  except Exception:
230
  msg = "CSV saved to {}. ".format(dest)
 
343
  def to_bool(v):
344
  return v is True or str(v).strip().lower() in ("true","1","yes","x","on","✓")
345
 
346
+ approved_df = df[pd.Series(list(map(to_bool, list(df[approve_col]))), index=df.index)]
347
 
348
  if len(approved_df) == 0:
349
  guide = (