Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| from transformers import pipeline | |
| # Load your model | |
| def load_model(): | |
| return pipeline("text-classification", model="KevSun/Personality_LM") | |
| model = load_model() | |
| st.title("Personality Prediction App") | |
| st.write("Enter your text below to predict personality traits:") | |
| user_input = st.text_area("Your text here:") | |
| if st.button("Predict"): | |
| if user_input: | |
| # Process the input and get predictions | |
| with st.spinner("Analyzing..."): | |
| result = model(user_input) | |
| # Display results | |
| st.subheader("Predicted personality traits:") | |
| for trait in result: | |
| st.write(f"- {trait['label']}: {trait['score']:.2f}") | |
| else: | |
| st.warning("Please enter some text to analyze.") | |
| st.info("Note: This is a demonstration and predictions may not be entirely accurate.") |