devanshsrivastav commited on
Commit
af96193
1 Parent(s): dd67db3

removed unused code and removed menu and streamlit footer

Browse files
Files changed (1) hide show
  1. EDxHuggingface.py +11 -11
EDxHuggingface.py CHANGED
@@ -66,15 +66,6 @@ label_hs = {"LABEL_0": "Acceptable", "LABEL_1": "inappropriate", "LABEL_2": "Off
66
 
67
  # Define default options
68
 
69
- def format_option(option):
70
- # Set the maximum length of the option text you want to display
71
- max_length = 200
72
- if len(option) > max_length:
73
- # Truncate the option text and add ellipsis at the end
74
- return option[:max_length] + '...'
75
- else:
76
- return option
77
-
78
  default_options = [
79
  "I'm so excited for my vacation next week!",
80
  "I'm feeling so stressed about work.",
@@ -96,7 +87,7 @@ with st.sidebar:
96
  #st.markdown(description)
97
 
98
  # Create dropdown with default options
99
- selected_option = st.selectbox("Select a default option or enter your own text:", default_options, format_func=lambda x: format_option(x))
100
 
101
  # Display text input with selected option as default value
102
  text_input = st.text_area("Enter text to analyze emotions:", value = selected_option, height=100)
@@ -185,4 +176,13 @@ if submit:
185
  st.text("")
186
  st.markdown(f"#### The given text is {hate_detection}")
187
 
188
-
 
 
 
 
 
 
 
 
 
 
66
 
67
  # Define default options
68
 
 
 
 
 
 
 
 
 
 
69
  default_options = [
70
  "I'm so excited for my vacation next week!",
71
  "I'm feeling so stressed about work.",
 
87
  #st.markdown(description)
88
 
89
  # Create dropdown with default options
90
+ selected_option = st.selectbox("Select a default option or enter your own text:", default_options)
91
 
92
  # Display text input with selected option as default value
93
  text_input = st.text_area("Enter text to analyze emotions:", value = selected_option, height=100)
 
176
  st.text("")
177
  st.markdown(f"#### The given text is {hate_detection}")
178
 
179
+
180
+
181
+
182
+ hide_st_style = """
183
+ <style>
184
+ #MainMenu {visibility: hidden;}
185
+ footer {visibility: hidden;}
186
+ </style>
187
+ """
188
+ st.markdown(hide_st_style, unsafe_allow_html=True)