botsi commited on
Commit
8477a4d
·
verified ·
1 Parent(s): cf7c684

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -66,6 +66,8 @@ if torch.cuda.is_available():
66
  tokenizer = AutoTokenizer.from_pretrained(model_id)
67
  tokenizer.use_default_system_prompt = False
68
 
 
 
69
  def fetch_personalized_data(session_index):
70
  try:
71
  # Connect to the database
@@ -103,10 +105,8 @@ def fetch_personalized_data(session_index):
103
  FROM e5390g37096_core
104
  JOIN e5390g37096_decisions ON
105
  e5390g37096_core.playerNr = e5390g37096_decisions.playerNr
106
- WHERE e5390g37096_decisions.session_index = '{session_index}'
107
-
108
  UNION ALL
109
-
110
  SELECT e5390g37096_core.playerNr,
111
  e5390g37096_core.groupNrStart,
112
  e5390g37096_core.subjectNr,
@@ -136,8 +136,8 @@ def fetch_personalized_data(session_index):
136
  FROM e5390g37096_core
137
  JOIN e5390g37096_decisions
138
  ON e5390g37096_core.playerNr = e5390g37096_decisions.playerNr
139
- WHERE e5390g37096_decisions.session_index = '{session_index}'
140
- ) AND e5390g37096_decisions.session_index != '{session_index}'
141
  """
142
  cursor.execute(query, (session_index, session_index, session_index))
143
  # Fetch data row by row
@@ -169,7 +169,7 @@ def fetch_personalized_data(session_index):
169
  except mysql.connector.Error as err:
170
  print(f"Error: {err}")
171
  return None
172
-
173
 
174
  def get_window_url_params():
175
  return """
 
66
  tokenizer = AutoTokenizer.from_pretrained(model_id)
67
  tokenizer.use_default_system_prompt = False
68
 
69
+ import mysql.connector
70
+
71
  def fetch_personalized_data(session_index):
72
  try:
73
  # Connect to the database
 
105
  FROM e5390g37096_core
106
  JOIN e5390g37096_decisions ON
107
  e5390g37096_core.playerNr = e5390g37096_decisions.playerNr
108
+ WHERE e5390g37096_decisions.session_index = %s
 
109
  UNION ALL
 
110
  SELECT e5390g37096_core.playerNr,
111
  e5390g37096_core.groupNrStart,
112
  e5390g37096_core.subjectNr,
 
136
  FROM e5390g37096_core
137
  JOIN e5390g37096_decisions
138
  ON e5390g37096_core.playerNr = e5390g37096_decisions.playerNr
139
+ WHERE e5390g37096_decisions.session_index = %s
140
+ ) AND e5390g37096_decisions.session_index != %s
141
  """
142
  cursor.execute(query, (session_index, session_index, session_index))
143
  # Fetch data row by row
 
169
  except mysql.connector.Error as err:
170
  print(f"Error: {err}")
171
  return None
172
+
173
 
174
  def get_window_url_params():
175
  return """