Spaces:
Sleeping
Sleeping
Download app.py from FPRT/ThematicAnalysis: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/spaces/FPRT/ThematicAnalysis/resolve/main/app.py
- Command line
-
hf download hf://spaces/FPRT/ThematicAnalysis/app.py
-
curl -L -o app.py https://huggingface.co/spaces/FPRT/ThematicAnalysis/resolve/main/app.py
579 Bytes
| from transformers import pipeline | |
| import streamlit as st | |
| model_name = "FPRT/bert-fine-tuned-stepkids-classification" | |
| pipe = pipeline(model=model_name) | |
| def main(): | |
| st.title("Hugging Face Model Demo") | |
| # Create an input text box | |
| input_text = st.text_input("Enter your text", "") | |
| # Create a button to trigger model inference | |
| if st.button("Analyze"): | |
| # Perform inference using the loaded model | |
| result = pipe(input_text) | |
| st.write("Prediction:", result[0]['label'], "| Score:", result[0]['score']) | |
| if __name__ == "__main__": | |
| main() |