VyLala commited on
Commit
f3b0e2e
·
verified ·
1 Parent(s): 18806a8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py CHANGED
@@ -317,6 +317,33 @@ with gr.Blocks() as interface:
317
  if not email.strip():
318
  output_file_path = None#"Write your email so that you can download the outputs."
319
  log_lines.append("📥 Provide your email to receive a downloadable Excel report and get 20 more free queries.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  # Step 2: Loop through accessions
321
  for i, acc in enumerate(accessions):
322
  if global_stop_flag.value:
 
317
  if not email.strip():
318
  output_file_path = None#"Write your email so that you can download the outputs."
319
  log_lines.append("📥 Provide your email to receive a downloadable Excel report and get 20 more free queries.")
320
+ if email.strip():
321
+ usage_count = increment_usage(email, processed_accessions)
322
+ if int(usage_count) > 50:
323
+ log_lines.append("❌ You have reached your quota. Please contact us to unlock more.")
324
+
325
+ # Minimal blank yield to trigger UI rendering
326
+ yield (
327
+ make_html_table([]),
328
+ gr.update(visible=True),
329
+ gr.update(visible=False),
330
+ gr.update(value="", visible=True),
331
+ "⛔️ Quota limit",
332
+ "⛔️ Quota limit"
333
+ )
334
+
335
+ # Actual warning frame
336
+ yield (
337
+ make_html_table([]),
338
+ gr.update(visible=False),
339
+ gr.update(visible=False),
340
+ gr.update(value="❌ You have reached your quota. Please contact us to unlock more.", visible=True),
341
+ "❌ Quota Exceeded",
342
+ "\n".join(log_lines)
343
+ )
344
+ return
345
+
346
+
347
  # Step 2: Loop through accessions
348
  for i, acc in enumerate(accessions):
349
  if global_stop_flag.value: