Download app.py from automatethem-front-python-etc/son-height-tabular-regression-app-streamlit-api-flask-model-scikit-learn: direct link, hf CLI and curl.
- Browser
- Download file 556 Bytes
-
https://huggingface.co/spaces/automatethem-front-python-etc/son-height-tabular-regression-app-streamlit-api-flask-model-scikit-learn/resolve/main/app.py
- Command line
-
hf download hf://spaces/automatethem-front-python-etc/son-height-tabular-regression-app-streamlit-api-flask-model-scikit-learn/app.py
-
curl -L -o app.py https://huggingface.co/spaces/automatethem-front-python-etc/son-height-tabular-regression-app-streamlit-api-flask-model-scikit-learn/resolve/main/app.py
556 Bytes
| import streamlit as st | |
| import requests | |
| url = 'https://automatethem.pythonanywhere.com/son-height-tabular-regression-scikit-learn/api' | |
| number = st.number_input('아버지 키', value=175.0, step=0.1) | |
| button = st.button('아들 키 예측') | |
| if button: | |
| container = st.container() | |
| container.caption("예측 결과") | |
| payload = {'data': [{'x': str(number)}]} | |
| response = requests.post(url, json=payload) | |
| outputs = response.json() | |
| #print(outputs) #{'data': [{'logit': 175.99442286524624}]} | |
| container.text(outputs['data'][0]['logit']) |