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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -474,16 +474,15 @@ def check_token(token):
474
  api = HfApi(token=token)
475
  user_data = api.whoami()
476
  except Exception as e:
477
- raise gr.Warning("Invalid user token. Make sure to get your Hugging Face token from the settings page")
478
  else:
479
- print(user_data)
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 methods aren't set up. You gotta set them 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)
 
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)