broadfield-dev commited on
Commit
acd0086
·
verified ·
1 Parent(s): 13b7cd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from gradio_client import Client, GradioClientError
3
  from PIL import Image
4
  import base64
5
  import io
@@ -48,10 +48,6 @@ def call_api(server_space_id: str, image: Image.Image) -> dict:
48
  # The result from a successful predict call is the data itself.
49
  return result
50
 
51
- except GradioClientError as e:
52
- # Handle errors from the gradio_client library (e.g., 404, server errors)
53
- logger.error(f"Gradio Client Error: {e}")
54
- raise gr.Error(f"API Call Failed: {e}. Check if the Server Space ID is correct and the server is running.")
55
  except Exception as e:
56
  # Handle other unexpected errors
57
  logger.error(f"An unexpected client-side error occurred: {e}", exc_info=True)
 
1
  import gradio as gr
2
+ from gradio_client import Client
3
  from PIL import Image
4
  import base64
5
  import io
 
48
  # The result from a successful predict call is the data itself.
49
  return result
50
 
 
 
 
 
51
  except Exception as e:
52
  # Handle other unexpected errors
53
  logger.error(f"An unexpected client-side error occurred: {e}", exc_info=True)