Zhu-FaceOnLive commited on
Commit
89192b5
Β·
verified Β·
1 Parent(s): 2246df0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -82,12 +82,15 @@ def search_face(file, token_txt, request: gr.Request):
82
  api_name="/search_face"
83
  )
84
  except:
85
- backend = Client(BACKEND, auth=[USER, PASS])
86
- result_text = backend.predict(
87
- file=file1,
88
- token=token_txt,
89
- api_name="/search_face"
90
- )
 
 
 
91
 
92
  result = json.loads(result_text)
93
  outarray = []
 
82
  api_name="/search_face"
83
  )
84
  except:
85
+ try:
86
+ backend = Client(BACKEND, auth=[USER, PASS])
87
+ result_text = backend.predict(
88
+ file=file1,
89
+ token=token_txt,
90
+ api_name="/search_face"
91
+ )
92
+ except:
93
+ return []
94
 
95
  result = json.loads(result_text)
96
  outarray = []