Sqxww commited on
Commit
08cb1fd
·
1 Parent(s): db5909d

change backend host

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -43,11 +43,15 @@ def change_image_style(
43
  "prompt_prefix": prompt_prefix
44
  }
45
 
46
- response = requests.post(
47
- "https://api.hkhappymobile.com/tools/change-image-style",
48
- json=data,
49
- headers={"content-type": "application/json"}
50
- )
 
 
 
 
51
 
52
  if response.status_code == 200:
53
  data = response.json().get("data")
 
43
  "prompt_prefix": prompt_prefix
44
  }
45
 
46
+ try:
47
+ response = requests.post(
48
+ "http://3.20.241.172/tools/change-image-style",
49
+ json=data,
50
+ headers={"content-type": "application/json"}
51
+ )
52
+ except Exception as e:
53
+ error_msg = f"Error occurred while requesting backend tool: {e}"
54
+ return "", "", error_msg
55
 
56
  if response.status_code == 200:
57
  data = response.json().get("data")