Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,29 +2,29 @@ import streamlit as st
|
|
2 |
from BART_utils import get_prob, judge_mbti, compute_score, mbti_translator, plot_mbti, device
|
3 |
|
4 |
|
5 |
-
st.title("MBTI
|
6 |
if device == "cpu":
|
7 |
processor = "๐ฅ๏ธ"
|
8 |
else:
|
9 |
processor = "๐ฝ"
|
10 |
st.subheader("Running on {}".format(device + processor))
|
11 |
|
12 |
-
st.header("
|
13 |
-
st.write("
|
14 |
-
st.
|
15 |
-
st.write("
|
16 |
-
st.write("
|
17 |
|
18 |
-
user_input = st.text_input("
|
19 |
-
submit = st.button("
|
20 |
|
21 |
if submit:
|
22 |
-
with st.spinner("AI
|
23 |
output_mbti, output_ratio = mbti_translator(
|
24 |
user_input)
|
25 |
|
26 |
st.success("Success")
|
27 |
-
st.subheader("
|
28 |
|
29 |
for result in output_ratio:
|
30 |
-
plot_mbti(result)
|
|
|
2 |
from BART_utils import get_prob, judge_mbti, compute_score, mbti_translator, plot_mbti, device
|
3 |
|
4 |
|
5 |
+
st.title("MBTI translator")
|
6 |
if device == "cpu":
|
7 |
processor = "๐ฅ๏ธ"
|
8 |
else:
|
9 |
processor = "๐ฝ"
|
10 |
st.subheader("Running on {}".format(device + processor))
|
11 |
|
12 |
+
st.header("๐ปInfer my MBTI from my langauge (What I speak)")
|
13 |
+
st.write("๐คGive any sentences: I'll try to guess your MBTI")
|
14 |
+
st.header("๐คHow it works??:")
|
15 |
+
st.write("Using Zero-Shot NLI model, it computes probability of sentence and MBTI keywords")
|
16 |
+
st.write("More about the model: https://github.com/ethHong/mbti_translator_demo")
|
17 |
|
18 |
+
user_input = st.text_input("๐๐Put your sentence here", "I stayed home all day")
|
19 |
+
submit = st.button("Generate:)
|
20 |
|
21 |
if submit:
|
22 |
+
with st.spinner("AI is analysing result..."):
|
23 |
output_mbti, output_ratio = mbti_translator(
|
24 |
user_input)
|
25 |
|
26 |
st.success("Success")
|
27 |
+
st.subheader("๐คProbable MBTI is...๐ : " + output_mbti)
|
28 |
|
29 |
for result in output_ratio:
|
30 |
+
plot_mbti(result)
|