Nightfury16 commited on
Commit
8d82fea
·
1 Parent(s): 4678f33

Initial commit

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -31,7 +31,6 @@ def init_files():
31
  elif f == VERIFY_FILE: cols = ["timestamp", "user", "group_id", "url", "is_correct", "corrected_label"]
32
  else: cols = ["timestamp", "user", "group_id"]
33
  pd.DataFrame(columns=cols).to_csv(f, index=False)
34
-
35
  if not os.path.exists(URL_FILE):
36
  with open(URL_FILE, "w") as f: f.write("")
37
 
@@ -50,7 +49,8 @@ def get_image_optimized(url):
50
  return img
51
  except:
52
  pass
53
- return url
 
54
 
55
  def get_ordered_groups():
56
  groups = []
@@ -247,7 +247,7 @@ def refresh_cat():
247
  data.append([i+1, s, gid])
248
  return pd.DataFrame(data, columns=["#", "Status", "ID"])
249
 
250
- with gr.Blocks(title="Fast Labeler", theme=gr.themes.Soft()) as demo:
251
 
252
  state_mode = gr.State("label")
253
  state_hist = gr.State([])
@@ -314,4 +314,4 @@ with gr.Blocks(title="Fast Labeler", theme=gr.themes.Soft()) as demo:
314
  b_ref_cat.click(refresh_cat, None, df_cat)
315
  demo.load(refresh_cat, None, df_cat).then(get_stats_text, None, top_stats)
316
 
317
- demo.queue().launch()
 
31
  elif f == VERIFY_FILE: cols = ["timestamp", "user", "group_id", "url", "is_correct", "corrected_label"]
32
  else: cols = ["timestamp", "user", "group_id"]
33
  pd.DataFrame(columns=cols).to_csv(f, index=False)
 
34
  if not os.path.exists(URL_FILE):
35
  with open(URL_FILE, "w") as f: f.write("")
36
 
 
49
  return img
50
  except:
51
  pass
52
+
53
+ return url
54
 
55
  def get_ordered_groups():
56
  groups = []
 
247
  data.append([i+1, s, gid])
248
  return pd.DataFrame(data, columns=["#", "Status", "ID"])
249
 
250
+ with gr.Blocks(title="Fast Labeler") as demo:
251
 
252
  state_mode = gr.State("label")
253
  state_hist = gr.State([])
 
314
  b_ref_cat.click(refresh_cat, None, df_cat)
315
  demo.load(refresh_cat, None, df_cat).then(get_stats_text, None, top_stats)
316
 
317
+ demo.queue().launch(theme=gr.themes.Soft())