Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
# Load your model
|
| 5 |
+
model = pipeline("text-classification", model="KevSun/Personality_LM")
|
| 6 |
+
|
| 7 |
+
st.title("Personality Prediction App")
|
| 8 |
+
|
| 9 |
+
st.write("Enter your text below to predict personality traits:")
|
| 10 |
+
|
| 11 |
+
user_input = st.text_area("Your text here:")
|
| 12 |
+
|
| 13 |
+
if st.button("Predict"):
|
| 14 |
+
if user_input:
|
| 15 |
+
# Process the input and get predictions
|
| 16 |
+
result = model(user_input)
|
| 17 |
+
|
| 18 |
+
# Display results
|
| 19 |
+
st.write("Predicted personality traits:")
|
| 20 |
+
st.write(result)
|
| 21 |
+
else:
|
| 22 |
+
st.write("Please enter some text to analyze.")
|