Seetha commited on
Commit
eae1e5f
1 Parent(s): 8b4de75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -172,7 +172,7 @@ def main():
172
  pred_val = [list_pred[i] for i in pred1]
173
 
174
  #print('count',count)
175
- for find,(sent,preds) in enumerate(zip(class_list,pred_val)):
176
  if 'customers' in sent or 'client' in sent or 'consumer' in sent or 'user' in sent:
177
  pred_val[ind] = 'Customers'
178
  elif 'investor' in sent or 'finance' in sent or 'shareholder' in sent or 'stockholder' in sent or 'owners' in sent:
@@ -505,8 +505,11 @@ def main():
505
  json_data = json.dumps(data_list)
506
 
507
  # Write the JSON data to a file
508
- with open(json_file, "w") as f:
 
 
509
  f.write(json_data)
 
510
  # api.upload_file(
511
  # path_or_fileobj=json_data,
512
  # path_in_repo="ch.json",
 
172
  pred_val = [list_pred[i] for i in pred1]
173
 
174
  #print('count',count)
175
+ for ind,(sent,preds) in enumerate(zip(class_list,pred_val)):
176
  if 'customers' in sent or 'client' in sent or 'consumer' in sent or 'user' in sent:
177
  pred_val[ind] = 'Customers'
178
  elif 'investor' in sent or 'finance' in sent or 'shareholder' in sent or 'stockholder' in sent or 'owners' in sent:
 
505
  json_data = json.dumps(data_list)
506
 
507
  # Write the JSON data to a file
508
+ with open(json_file, "r+") as f:
509
+ data = f.read()
510
+ f.seek(0)
511
  f.write(json_data)
512
+ f.truncate()
513
  # api.upload_file(
514
  # path_or_fileobj=json_data,
515
  # path_in_repo="ch.json",