fix(proxy_server.py): reject bad /model/new POST requests

This commit is contained in:
Krrish Dholakia 2024-01-03 15:54:46 +05:30
parent cc29860785
commit 40c974999e
2 changed files with 18 additions and 6 deletions

View file

@ -127,6 +127,7 @@ def admin_page(is_admin="NOT_GIVEN"):
"mode": mode_selected,
},
}
print(f"model_info: {model_info}")
# Make the POST request to the specified URL
complete_url = ""
if st.session_state["proxy_url"].endswith("/"):
@ -143,7 +144,7 @@ def admin_page(is_admin="NOT_GIVEN"):
st.success("Model added successfully!")
else:
st.error(
f"Failed to add model. Status code: {response.status_code}"
f"Failed to add model. Status code: {response.status_code}; Error Message: {response.json()['detail']}"
)
st.success("Form submitted successfully!")