dodijk commited on
Commit
a4158a1
1 Parent(s): e72bae6

Show error in HF Spaces.

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -137,6 +137,7 @@ def get_auto_comparison(url, target, smoothing_window_size=10, method="CUSUM"):
137
  """ Function for Gradio to combine all helper functions"""
138
  distance = get_decent_distance(url, target, MIN_DISTANCE, MAX_DISTANCE)
139
  if distance == None:
 
140
  raise gr.Error("No matches found!")
141
  video_index, hash_vectors, target_indices = get_video_indices(url, target, MIN_DISTANCE = distance)
142
  lims, D, I, hash_vectors = compare_videos(hash_vectors, target_indices, MIN_DISTANCE = distance)
@@ -175,5 +176,5 @@ if __name__ == "__main__":
175
  import matplotlib
176
  matplotlib.use('SVG') # To be able to plot in gradio
177
 
178
- iface.launch(inbrowser=True, debug=True)
179
  #iface.launch(auth=("test", "test"), share=True, debug=True)
 
137
  """ Function for Gradio to combine all helper functions"""
138
  distance = get_decent_distance(url, target, MIN_DISTANCE, MAX_DISTANCE)
139
  if distance == None:
140
+ return None
141
  raise gr.Error("No matches found!")
142
  video_index, hash_vectors, target_indices = get_video_indices(url, target, MIN_DISTANCE = distance)
143
  lims, D, I, hash_vectors = compare_videos(hash_vectors, target_indices, MIN_DISTANCE = distance)
 
176
  import matplotlib
177
  matplotlib.use('SVG') # To be able to plot in gradio
178
 
179
+ iface.launch(show_error=True)
180
  #iface.launch(auth=("test", "test"), share=True, debug=True)