elibrowne commited on
Commit
068bb16
·
1 Parent(s): c20f0de

Temporary user profile

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -58,6 +58,22 @@ def load_user_data(id):
58
  # Run the update method to upload the new JSON file to HuggingFace
59
  update_huggingface(id)
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  def update_huggingface(id):
62
  global user_data
63
  filename = id.replace('@', '_AT_').replace('.', '_DOT_')
 
58
  # Run the update method to upload the new JSON file to HuggingFace
59
  update_huggingface(id)
60
 
61
+ # DELETE ONCE LOGIN IS IMPLEMENTED
62
+ shuffle(qIDs)
63
+ modes = []
64
+ for i in range(len(qIDs)):
65
+ temp = mode_options[:]
66
+ shuffle(temp)
67
+ modes.append(temp)
68
+ # This is the format for a user's file on HuggingFace
69
+ user_data = {
70
+ "user_id": id, # original in email format, which was passed here
71
+ "order": qIDs, # randomized order for each user
72
+ "modes": modes, # randomized order for each user
73
+ "current": 0, # user starts on first question
74
+ "responses": [] # formatted as a list of current_responses
75
+ }
76
+
77
  def update_huggingface(id):
78
  global user_data
79
  filename = id.replace('@', '_AT_').replace('.', '_DOT_')