davidlee1102 commited on
Commit
8a48d0e
1 Parent(s): 6911d6a
Files changed (2) hide show
  1. app.py +7 -8
  2. example.log +0 -0
app.py CHANGED
@@ -1,13 +1,14 @@
1
  import streamlit as st
2
 
3
  from emotion_model import emotion_predict
4
- from transformers import logging
5
  from datetime import datetime
6
-
7
- # Enable logging
8
- logging.set_verbosity_info()
9
 
10
  name = st.text_input("Enter your sentence here")
 
 
 
 
11
  if (st.button('Submit')):
12
  result = name.title()
13
  try:
@@ -20,10 +21,8 @@ if (st.button('Submit')):
20
  user_response = st.text_input("Please give your emotion that you are thinking is correct")
21
  if (st.button('Submit Feedback')):
22
  if user_response:
23
- st.success("Thank you for contributing")
24
- logging.set_verbosity_info()
25
  logging.info(f"{result}, {result_check}, {user_response}, {datetime.now()}")
26
  else:
27
- st.success("Thank you for using")
28
- logging.set_verbosity_info()
29
  logging.info(f"{result}, {result_check}, {datetime.now()}")
 
1
  import streamlit as st
2
 
3
  from emotion_model import emotion_predict
 
4
  from datetime import datetime
5
+ import logging
 
 
6
 
7
  name = st.text_input("Enter your sentence here")
8
+ result = ""
9
+ result_check = ""
10
+ logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)
11
+
12
  if (st.button('Submit')):
13
  result = name.title()
14
  try:
 
21
  user_response = st.text_input("Please give your emotion that you are thinking is correct")
22
  if (st.button('Submit Feedback')):
23
  if user_response:
24
+ st.info("Thank you for contributing")
 
25
  logging.info(f"{result}, {result_check}, {user_response}, {datetime.now()}")
26
  else:
27
+ st.info("Thank you for using")
 
28
  logging.info(f"{result}, {result_check}, {datetime.now()}")
example.log ADDED
File without changes