Seetha commited on
Commit
8427a9c
1 Parent(s): 50fed5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -488,16 +488,13 @@ def main():
488
  'target': col,
489
  'value': int(df_tab.loc[row, col])
490
  })
491
-
492
- def save_feedback():
493
- """
494
- Append input/outputs and user feedback to a JSON Lines file using a thread lock to avoid concurrent writes from different users.
495
- """
496
- with scheduler.lock:
497
- with feedback_file.open("w") as f:
498
- json.dump(json_data, f)
499
- #f.write(json.dumps({"input": input_text, "output_1": output_1, "output_2": output_2, "user_choice": user_choice}))
500
- # f.write("\n")
501
 
502
  # dataset = load_dataset("Seetha/Visualization")
503
  # st.write(dataset)
@@ -529,11 +526,11 @@ def main():
529
 
530
  # #return generate_html()
531
  #with gr.Blocks() as demo:
532
- iface = gr.Interface(
533
- save_feedback()
534
- )
535
 
536
- iface.launch()
537
 
538
  #f.truncate()
539
 
 
488
  'target': col,
489
  'value': int(df_tab.loc[row, col])
490
  })
491
+ dat = json.dump(json_data)
492
+ with open('level2.json','r+') as fi:
493
+ data = fi.read()
494
+ #st.write(data)
495
+ fi.seek(0)
496
+ fi.write(dat)
497
+ fi.truncate()
 
 
 
498
 
499
  # dataset = load_dataset("Seetha/Visualization")
500
  # st.write(dataset)
 
526
 
527
  # #return generate_html()
528
  #with gr.Blocks() as demo:
529
+ # iface = gr.Interface(
530
+ # save_feedback()
531
+ # )
532
 
533
+ # iface.launch()
534
 
535
  #f.truncate()
536