KevSun commited on
Commit
8b7655d
·
verified ·
1 Parent(s): d902520

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -7,14 +7,6 @@ def install(package):
7
 
8
  st.title("Personality Prediction App")
9
 
10
- # Check and install transformers library
11
- try:
12
- from transformers import pipeline
13
- except ImportError:
14
- st.warning("The transformers library is not installed. Attempting to install it now...")
15
- install('transformers')
16
- st.experimental_rerun()
17
-
18
  # Check and install numpy library
19
  try:
20
  import numpy as np
@@ -23,6 +15,14 @@ except ImportError:
23
  install('numpy')
24
  st.experimental_rerun()
25
 
 
 
 
 
 
 
 
 
26
  @st.cache_resource
27
  def load_model():
28
  return pipeline("text-classification", model="KevSun/Personality_LM")
@@ -46,3 +46,4 @@ if st.button("Predict"):
46
 
47
  st.info("Note: This is a demonstration and predictions may not be entirely accurate.")
48
 
 
 
7
 
8
  st.title("Personality Prediction App")
9
 
 
 
 
 
 
 
 
 
10
  # Check and install numpy library
11
  try:
12
  import numpy as np
 
15
  install('numpy')
16
  st.experimental_rerun()
17
 
18
+ # Check and install transformers library
19
+ try:
20
+ from transformers import pipeline
21
+ except ImportError:
22
+ st.warning("The transformers library is not installed. Attempting to install it now...")
23
+ install('transformers')
24
+ st.experimental_rerun()
25
+
26
  @st.cache_resource
27
  def load_model():
28
  return pipeline("text-classification", model="KevSun/Personality_LM")
 
46
 
47
  st.info("Note: This is a demonstration and predictions may not be entirely accurate.")
48
 
49
+