multimodalart HF staff commited on
Commit
ac5ec86
1 Parent(s): 9227886

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -474,15 +474,16 @@ def check_token(token):
474
  api = HfApi(token=token)
475
  user_data = api.whoami()
476
  except Exception as e:
477
- raise gr.Info("Invalid user token. Make sure to get your Hugging Face token from the settings page")
 
478
  else:
479
  if (user_data['auth']['accessToken']['role'] != "write"):
480
- gr.Info("Ops, you've uploaded a `Read` token. You need to use a Write token!")
481
  else:
482
  if user_data['canPay']:
483
  return gr.update(visible=False), gr.update(visible=True)
484
  else:
485
- gr.Info("Your payment method isn't set up. You gotta set them up to start training")
486
  return gr.update(visible=True), gr.update(visible=False)
487
 
488
  return gr.update(visible=False), gr.update(visible=False)
 
474
  api = HfApi(token=token)
475
  user_data = api.whoami()
476
  except Exception as e:
477
+ gr.Warning("Invalid user token. Make sure to get your Hugging Face token from the settings page")
478
+ return gr.update(visible=False), gr.update(visible=False)
479
  else:
480
  if (user_data['auth']['accessToken']['role'] != "write"):
481
+ gr.Warning("Ops, you've uploaded a `Read` token. You need to use a Write token!")
482
  else:
483
  if user_data['canPay']:
484
  return gr.update(visible=False), gr.update(visible=True)
485
  else:
486
+ gr.Warning("Your payment method isn't set up. You gotta it up to start training")
487
  return gr.update(visible=True), gr.update(visible=False)
488
 
489
  return gr.update(visible=False), gr.update(visible=False)