pragnakalp commited on
Commit
1d07330
1 Parent(s): bd0f1db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -113,20 +113,19 @@ def generate_emotion(article):
113
  """
114
  Save generated details
115
  """
116
- def save_data_and_sendmail(results_dict,sen_list,results):
117
  try:
118
  hostname = {}
 
119
 
120
- add_csv = [results_dict]
121
  with open(DATA_FILE, "a") as f:
122
  writer = csv.writer(f)
123
  # write the data
124
  writer.writerow(add_csv)
125
  commit_url = repo.push_to_hub()
126
  print("commit data :",commit_url)
127
-
128
- hostname = get_device_ip_address()
129
- print("hostname ",hostname)
130
  url = 'https://pragnakalpdev35.pythonanywhere.com/hf_space_emotion_detection'
131
  # url = 'http://pragnakalpdev33.pythonanywhere.com/HF_space_question_generator'
132
  myobj = {'sen_list': sen_list,'gen_results': results,'ip_addr':hostname.get("ip_addr",""),'host':hostname.get("host","")}
 
113
  """
114
  Save generated details
115
  """
116
+ def save_data_and_sendmail(article,results_dict,sen_list,results):
117
  try:
118
  hostname = {}
119
+ hostname = get_device_ip_address()
120
 
121
+ add_csv = [article,results_dict,hostname.get("ip_addr","")]
122
  with open(DATA_FILE, "a") as f:
123
  writer = csv.writer(f)
124
  # write the data
125
  writer.writerow(add_csv)
126
  commit_url = repo.push_to_hub()
127
  print("commit data :",commit_url)
128
+
 
 
129
  url = 'https://pragnakalpdev35.pythonanywhere.com/hf_space_emotion_detection'
130
  # url = 'http://pragnakalpdev33.pythonanywhere.com/HF_space_question_generator'
131
  myobj = {'sen_list': sen_list,'gen_results': results,'ip_addr':hostname.get("ip_addr",""),'host':hostname.get("host","")}