tung commited on
Commit
d3c927d
Β·
1 Parent(s): 30fef7a

fix: non-existent dir

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -100,6 +100,7 @@ def _upload_remote_ratings(df: pd.DataFrame):
100
 
101
  with tempfile.TemporaryDirectory() as tmpdir:
102
  csv_path = Path(tmpdir) / RATINGS_FILE
 
103
  df.to_csv(csv_path, index=False)
104
  api.upload_file(
105
  path_or_fileobj=str(csv_path),
@@ -173,7 +174,7 @@ def start_or_resume(user_id: str, state_df):
173
  gr.update(value=user_id, visible=True),
174
  gr.update(visible=True), # eval_col
175
  gr.update(visible=True), # submit_btn
176
- q,
177
  a1,
178
  a2,
179
  str(idx),
@@ -200,7 +201,7 @@ def submit_preference(user_id: str, row_idx_str: str, choice: str, state_df):
200
  return "", "", "", "", "πŸŽ‰ You have evaluated every item – thank you!"
201
 
202
  idx, q, a1, a2 = record
203
- return q, a1, a2, str(idx), ""
204
 
205
 
206
  # -----------------------------------------------------------------------------
 
100
 
101
  with tempfile.TemporaryDirectory() as tmpdir:
102
  csv_path = Path(tmpdir) / RATINGS_FILE
103
+ csv_path.parent.mkdir(parents=True, exist_ok=True)
104
  df.to_csv(csv_path, index=False)
105
  api.upload_file(
106
  path_or_fileobj=str(csv_path),
 
174
  gr.update(value=user_id, visible=True),
175
  gr.update(visible=True), # eval_col
176
  gr.update(visible=True), # submit_btn
177
+ "**" + q + "**",
178
  a1,
179
  a2,
180
  str(idx),
 
201
  return "", "", "", "", "πŸŽ‰ You have evaluated every item – thank you!"
202
 
203
  idx, q, a1, a2 = record
204
+ return "**" + q + "**", a1, a2, str(idx), ""
205
 
206
 
207
  # -----------------------------------------------------------------------------