mislavb commited on
Commit
2e21199
·
1 Parent(s): 3d3344e

add more reps

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -2,11 +2,13 @@ import huggingface_hub
2
  import gradio as gr
3
  import pandas as pd
4
  import random
 
5
  import openai
6
  import os
7
  import requests
8
  import sqlite3
9
  import string
 
10
  import hashlib
11
  import dotenv
12
  import shutil
@@ -313,6 +315,7 @@ def summary_ch_hard(
313
 
314
 
315
  def run_summary_hard():
 
316
  now_utc = get_today_utc()
317
  print("RUNNING SUMMARY HARD AT (UTC time): ", now_utc)
318
  db = sqlite3.connect(DB_FILE)
@@ -346,15 +349,18 @@ def run_summary_hard():
346
  code = get_code(hard_challenge_secret)
347
  new_rows[3][1] = new_rows[3][1].replace("SECRET_PASSWORD", code)
348
 
 
349
  # add new rows to random positions in the table
350
- for new_row in new_rows:
351
- rows.insert(random.randint(0, len(rows)), new_row)
352
- print("new row: ", new_row)
353
-
354
- summary = get_summary(rows)
 
 
 
 
355
  print("hard summary: ", summary)
356
- print("end hard summary")
357
-
358
  db.close()
359
 
360
  try:
 
2
  import gradio as gr
3
  import pandas as pd
4
  import random
5
+ import copy
6
  import openai
7
  import os
8
  import requests
9
  import sqlite3
10
  import string
11
+ import time
12
  import hashlib
13
  import dotenv
14
  import shutil
 
315
 
316
 
317
  def run_summary_hard():
318
+ summary = ""
319
  now_utc = get_today_utc()
320
  print("RUNNING SUMMARY HARD AT (UTC time): ", now_utc)
321
  db = sqlite3.connect(DB_FILE)
 
349
  code = get_code(hard_challenge_secret)
350
  new_rows[3][1] = new_rows[3][1].replace("SECRET_PASSWORD", code)
351
 
352
+ orig_rows = copy.deepcopy(rows)
353
  # add new rows to random positions in the table
354
+ print("new rows: ", new_rows)
355
+ for rep in range(30):
356
+ rows = copy.deepcopy(orig_rows)
357
+ for new_row in new_rows:
358
+ rows.insert(random.randint(0, len(rows)), new_row)
359
+ summary += f"summary [{rep}]:\n" + get_summary(rows) + "\n"
360
+ # print(f"hard summary [{rep}]: ", summary)
361
+ # print("end hard summary")
362
+ time.sleep(1)
363
  print("hard summary: ", summary)
 
 
364
  db.close()
365
 
366
  try: