Spaces:
Running
on
Zero
Running
on
Zero
fix a bug
Browse files
Rodin.py
CHANGED
@@ -167,8 +167,14 @@ class Generator:
|
|
167 |
raise gr.Error("Error in image preprocessing, please try again.")
|
168 |
|
169 |
if 'error' in preprocess_response:
|
170 |
-
log("ERROR", f"Error in image preprocessing: {preprocess_response
|
171 |
-
raise
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
elif preprocess_response.get("statusCode") == 401:
|
173 |
log("WARNING", "Token expired. Logging in again...")
|
174 |
_, self.token = login(self.user_id, self.password)
|
|
|
167 |
raise gr.Error("Error in image preprocessing, please try again.")
|
168 |
|
169 |
if 'error' in preprocess_response:
|
170 |
+
log("ERROR", f"Error in image preprocessing: {preprocess_response}")
|
171 |
+
raise gr.Error("Error in image preprocessing, please try again.")
|
172 |
+
elif preprocess_response.get("statusCode") == 400:
|
173 |
+
if "InvalidFile.Content" in preprocess_response.get("message"):
|
174 |
+
raise gr.Error("Invalid Image Format")
|
175 |
+
else:
|
176 |
+
log("ERROR", f"Error in image preprocessing: {preprocess_response}")
|
177 |
+
raise gr.Error("Busy connection, please try again later.")
|
178 |
elif preprocess_response.get("statusCode") == 401:
|
179 |
log("WARNING", "Token expired. Logging in again...")
|
180 |
_, self.token = login(self.user_id, self.password)
|