fffiloni commited on
Commit
e8bcac0
·
verified ·
1 Parent(s): b3cd320

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,7 +13,7 @@ MAX_SEED = np.iinfo(np.int32).max
13
  def check_api(model_name):
14
  if model_name == "MAGNet":
15
  try :
16
- client = Client("fffiloni/MAGNet", hf_token=hf_token)
17
  return "api ready"
18
  except :
19
  return "api not ready yet"
@@ -244,8 +244,8 @@ def infer(image_in, chosen_model, api_status):
244
  if chosen_model == [] :
245
  raise gr.Error("Please pick a model")
246
 
247
- #if api_status == "api not ready yet" :
248
- # raise gr.Error("This model is not ready yet, you can pick another one instead :)")
249
 
250
  gr.Info("Getting image caption with Kosmos-2...")
251
  user_prompt = get_caption(image_in)
 
13
  def check_api(model_name):
14
  if model_name == "MAGNet":
15
  try :
16
+ client = Client("fffiloni/MAGNet")
17
  return "api ready"
18
  except :
19
  return "api not ready yet"
 
244
  if chosen_model == [] :
245
  raise gr.Error("Please pick a model")
246
 
247
+ if api_status == "api not ready yet" :
248
+ raise gr.Error("This model is not ready yet, you can pick another one instead :)")
249
 
250
  gr.Info("Getting image caption with Kosmos-2...")
251
  user_prompt = get_caption(image_in)