Spaces:
Running
Running
change backend host
Browse files
app.py
CHANGED
@@ -43,11 +43,15 @@ def change_image_style(
|
|
43 |
"prompt_prefix": prompt_prefix
|
44 |
}
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
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")
|