youngtsai commited on
Commit
25cbf06
·
1 Parent(s): e9e2b32

if "hf.space" in request_origin:

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1381,6 +1381,10 @@ def init_params(request: gr.Request):
1381
  admin_group = gr.update(visible=True)
1382
  user_data = gr.update(value="aa")
1383
 
 
 
 
 
1384
  # session timestamp 用 2024-01-01-12-00-00 格式, 要用 UTC+8 時間
1385
  session_timestamp = datetime.now(pytz.utc).astimezone(pytz.timezone('Asia/Taipei')).strftime("%Y-%m-%d-%H-%M-%S")
1386
 
 
1381
  admin_group = gr.update(visible=True)
1382
  user_data = gr.update(value="aa")
1383
 
1384
+ if "hf.space" in request_origin:
1385
+ admin_group = gr.update(visible=True)
1386
+ user_data = gr.update(value="aa")
1387
+
1388
  # session timestamp 用 2024-01-01-12-00-00 格式, 要用 UTC+8 時間
1389
  session_timestamp = datetime.now(pytz.utc).astimezone(pytz.timezone('Asia/Taipei')).strftime("%Y-%m-%d-%H-%M-%S")
1390