Download app.py from eijaz/2: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/spaces/eijaz/2/resolve/main/app.py
- Command line
-
hf download hf://spaces/eijaz/2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/eijaz/2/resolve/main/app.py
433 Bytes
| import streamlit as st | |
| import pandas as pd | |
| import joblib | |
| st.title("Stress Model") | |
| posts = st.text_area("Enter your concern") | |
| if st.button("Predict"): | |
| vector = joblib.load("stress.h5") | |
| predictions = vector.transform([posts]) | |
| model = joblib.load("stress_model.h5") | |
| pred = model.predict(predictions) | |
| st.success(pred) | |
| # We need not use conditional statements as its in labels and we didn;t encode it | |