voroninip commited on
Commit
7fb5135
Β·
verified Β·
1 Parent(s): 52f470a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -30,6 +30,16 @@ def format_predictions(preds) -> str:
30
  out += f"{i+1}. {item['label']} (score {item['score']:.2f})\n"
31
  return out
32
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  st.markdown("""
35
  <div style='text-align: center;'>
@@ -38,23 +48,12 @@ st.markdown("""
38
  """, unsafe_allow_html=True)
39
 
40
  st.markdown("""
41
- <h2 style='text-align: center; color: #e80ad8; font-family: Arial;'>
42
  πŸš€ arXiv paper categories predictor
43
  </h2>
44
  """, unsafe_allow_html=True)
45
 
46
-
47
- # CSS to change the background of the entire app
48
- background_color_css = """
49
- <style>
50
- .stApp {
51
- background-color: black; /* #eefcfa */
52
- }
53
- </style>
54
- """
55
-
56
  st.markdown("""
57
- <br><br> <!-- Adds vertical space -->
58
  <p style='
59
  color: white;
60
  font-size: 20px;
@@ -71,9 +70,7 @@ title = st.text_input("Title", value="")
71
 
72
  abstract = st.text_input("Abstract", value="")
73
 
74
- query = title + '\n' + abstract
75
- if title or abstract:
76
- st.markdown("""
77
  <p style='
78
  color: white;
79
  font-size: 20px;
@@ -82,5 +79,8 @@ if title or abstract:
82
  Most likely categories of the paper:
83
  </p>
84
  """, unsafe_allow_html=True)
 
 
 
85
  result = format_predictions(top_pct(model(query)[0]))
86
  st.write(result)
 
30
  out += f"{i+1}. {item['label']} (score {item['score']:.2f})\n"
31
  return out
32
 
33
+ st.markdown(
34
+ """
35
+ <style>
36
+ .stApp {
37
+ background: linear-gradient(to bottom right, #020420, #080f6b);
38
+ }
39
+ </style>
40
+ """,
41
+ unsafe_allow_html=True
42
+ )
43
 
44
  st.markdown("""
45
  <div style='text-align: center;'>
 
48
  """, unsafe_allow_html=True)
49
 
50
  st.markdown("""
51
+ <h2 style='text-align: center; color: lime; font-family: Arial;'>
52
  πŸš€ arXiv paper categories predictor
53
  </h2>
54
  """, unsafe_allow_html=True)
55
 
 
 
 
 
 
 
 
 
 
 
56
  st.markdown("""
 
57
  <p style='
58
  color: white;
59
  font-size: 20px;
 
70
 
71
  abstract = st.text_input("Abstract", value="")
72
 
73
+ st.markdown("""
 
 
74
  <p style='
75
  color: white;
76
  font-size: 20px;
 
79
  Most likely categories of the paper:
80
  </p>
81
  """, unsafe_allow_html=True)
82
+
83
+ query = title + '\n' + abstract
84
+ if title or abstract:
85
  result = format_predictions(top_pct(model(query)[0]))
86
  st.write(result)